Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Periodic retrieving data from DB
posted

I have an UltraWinGrid with two bands: Band A and Band B.

I need to refresh the data from DB every 5 seconds. In timer tick I call to function:

private void LoadData()

{

this.bandATableAdapter1.Fill(this.WebDataSet1.bandATable);

this.bandBTableAdapter1.Fill (this.WebDataSet1.bandBTable);

 

The problem is that grid blims and if I open the second band, after reloading data it closes by itself...

I tried to call to LoadData() function from backgroud thread, but the result is the same.

 Any suggestions?

 

 

Parents
No Data
Reply
  • 37774
    posted

    I think that by default the table adapter is going to clear the previous contents of your table and re-fill it, which would cause the grid to get a Reset notification, discarding the previous rows and needing to regenerate them.  Calling LoadData on a separate thread would likely not help the problem either, and would in fact likely cause more problems because now you're causing the UI to be updated asynchronously, which you cannot do in .NET.  The best solution is, I think, to set the ClearBeforeFill property of each of the table adapters to False.

    -Matt

Children
No Data