Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 28, 2010 07:31 PM by tefoster
Jun 26, 2010 07:00 AM|LINK
I'm working on a project where I have to create a page that displays the "health" of a system. I run a query and display the results in a gridview with a red or green icon next to it. This works fine when the page is first loaded. My problem is that I
have a thread that runs a query every 30 minutes and rebinds the gridview but the gridview never refreshes even though the data has changed. How do I get the gridview to display the new results? The databound event never fires a second time even though I
can clearly see that I have received new data. I assume I am missing something simple but I just don't know what. What am I doing wrong?
Jun 26, 2010 12:32 PM|LINK
please check your code again. please check your tread code.
or you can use Tick event of timer to check it is binding grid or not
Jun 26, 2010 01:18 PM|LINK
First time your gridview binds data perfeclty but not after tick event of timer control.
For bind the gridview after the 30 minutes means after tick event of timer your gridview should be in updatde panel.
If your gridview is not in UpdatePanel then after tick event it will not refresh the grid.
Add your gridview in updatde panel.
Jun 26, 2010 07:35 PM|LINK
The thread code is working fine. I have verified that the datatable is being filled with the correct updated information. When I bind it to the gridview the databound event is not fired, there is no postback and the gridview does not get updated.
Jun 28, 2010 02:05 PM|LINK
Jun 28, 2010 07:31 PM|LINK
Thank you for your reply! I didn't think about that approach but I used it and everything is working fine.