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
1050
grid refresh
posted

Hi,

I am using the ObservableCollection as the datasource for the grid.

In a button click i open another window and changing the data. and sending the message to the main window to refresh the grid.

but, setting the data source to null and setting the source again is not refreshing.

How can i refresh the grid to get the updated data?

Parents
No Data
Reply
  • 3627
    posted

    That doesn't sound right to me.

    The fact that it's an ObserveableCollection will inherently caseu the grid to update for CHANGED items, NEW items and REMOVED items. You won't need to refresh the list for CHANGED data. Of course, this all depends on what your definition of changing the data is.

    if you need to change out the entire collection and need the grid to refresh, you do as you mentioned, setting the DataSource -> null and then back to the new collection.

    One thought: what are the objects in the collection? Are they custom Classes? If so, you need to implement INotifyPropertyChanged so that the grid can see these individual property changes.

Children