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
1425
Refreshing Data from a Data Source in Memory
posted

Hi,

I'm using an UltraWinGrid to show real-time data and I'm looking for a way to show the most recent data when changes are made to the data source.

The new data from the data source is loaded into memory as a DataTable each time an update occurs. Currently, I'm rebinding the data to the grid each time, but it would be much smoother if I could simply refresh the Grid...

If I understand correctly, the UpdateData method only commits changes from the physical data source e.g. A Database. I'd like it to commit changes from a DataTable that will always have the same columns etc.

Any help will be greatly appreciated.

Cheers,

Richard

Parents
No Data
Reply
  • 12773
    Verified Answer
    posted

    Hello Richard,

    DataTable is a source that hold the data in their original state and also the changes. UpdateData is forcing to update the data from UltraGrdid to DataSource, but after then you need to take care of saving it. In your scenario you are interesting of way to  get updated data from DataTable. Let’s assume you make the changes already in your DataTable, if they come from other thread or some custom calculation. So you can just call AcceptChanges on your dataTable  or on the row that the change occur and you should see the new data in the grid.

    http://msdn.microsoft.com/en-us/library/system.data.datatable.acceptchanges.aspx

    I hope this make the thing more clear.

    Sincerely,
    Dimi
    Developer Support Engineer
    Infragistics, Inc.

Children