I have set the datasource of my radgrid to a generic list. But when I try clicking to add a new row....I get the error "The list must be an IBindingList to AddNew".
Is it not possible to add rows when using a generic list as my datasource?
Ryan
3 Answers, 1 is accepted
0
Julian Benkov
Telerik team
answered on 08 Aug 2008, 10:45 AM
Hi Ryan,
The IList generic does not support notification event like ListChanged and when you make some CRUD operation in the list the RadGridView will not receive notification. The IBindignList interface supports this behavior and it is implemented in DataTable, BindingSource and many other data objects. You can use its default implementation BindingList generic.
In order to support ItemChanged in BindingList too, you must implement INotifyPropertyChanged for your business object.
I hope this was helpful. If you have additional questions, please contact me.
All the best,
Julian Benkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The class and the interface that my colleague mentioned are not provider by Telerik. They are build-in type in .NET Framework. Hence, if you need to know more about them, you have to log on to MSDN websites.
You can read more about how you can implement INotifyPropertyChanged interface in this MSDN documentation article. Also you can see how to use BindingList<T> in this MSDN documentation page.
Best wishes,
Svett
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items