We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataControl and data changes on a DataSet

From other code, I want to add a row of data to a table that is bound to a GridDataControl on a XAML page. Since the dataset does not implement the INotifyPropertyChanges interface, the GridDataControl doesn't reflect the new row.

However, I created a class that inherits my stongly-typed dataset and implements the INotifyPropertyChanges interface. My new class subscribed to the strong-typed RowChange and TableNewRow events, raising the PropertyChanged event correctly. I put breakpoints in to confirm the event is being raised correctly. However, the GridDataControl still won't reflect a new row that gets added to the datatable.

I am using this method so that new datarows can be pre-populated with certain default and calculated data.

What am I missing--how can I get the GridDataControl to refresh its binding so that it will reflect added rows?

1 Reply

MS Mohamed Suhaib Fahad A. Syncfusion Team November 30, 2009 04:46 PM UTC

Hi Russell,

Thanks for using Syncfusion products. The INotifyPropertyChanged interface specifies only changes in the underlying objects, For the grid to recognize Add/Remove/Modify operations, You would have to implement INotifyCollectionChanged interface in the underlying collection that you set as ItemsSource to the Grid, If you want to use .NET FW collection, then ObservableCollection is the best to use.

We also recently added up IListChanged interface to specifically listen to that, although this is not available in our ES 2009 Volume 4 release, You can raise a DirectTrac incident to check out.

Please let me know if you need any more details.

Thanks,
Fahad

Loader.
Live Chat Icon For mobile
Up arrow icon