Solved

datagrid focus event for timer

Posted on 2011-02-18
8
302 Views
Last Modified: 2012-05-11
I have a timer on my page that refreshes my page, hte problem is that is someone is in the middle of updatinga row in the gridview it refreshes the page and there data disappears and then they need to starat over agian.  Is there a way to turn off the timer when they put focus on a row of the gridview to edit it.
0
Comment
Question by:kdeutsch
  • 3
  • 2
8 Comments
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 34927529
May be you should write the code into Timer_Tick() event. Ok
0
 

Author Comment

by:kdeutsch
ID: 34929212
Hi,
What code??  Is there a gridview focus event have no idea.
Protected Sub UPdateTimer_Tick(ByVal sender As Object, ByVal e As EventArgs)
        FillGrid()
    End Sub

Open in new window

0
 
LVL 25

Expert Comment

by:apeter
ID: 35033161
If  there is a user post back,while entering grid then you can set a hidden variable in code behind to true,

In the trigger function, check for the hidden variable. If it is false then refresh else don't
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:kdeutsch
ID: 35036075
Hi,

I guess I am not understanding this, if I have a gridview on my screen with textboxes in it and I start editing it, how can I set a value in a hidden field that will  not cause the refresh.
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 35041438
Through onchange event for textbox in javascript you can set your hidden field. All textbox in ur grid can update the same one hidden variable.
0
 

Author Closing Comment

by:kdeutsch
ID: 35046687
thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question