Hi team,
I have a datagrid whose datasource is bound to a List<SalesOrders>. What I would like to do here is
1) Add a new row to the grid and update the underlying database table when I click on some kind of commit/save button.
2) Update the database table when I update a cell value and click on some kind of commit/save button.
3) Remove a Row from the grid and update the underlying database table by deleting the corresponding row.
Thanks
Baba
Hello Baba,
Thank you for contacting Infragistics. The first thing to do is change your collection to an IList or ObservableCollection so it supports Add and RemoveAt methods to make your updates easier. Please review my sample attached. It demonstrates how to remove a record by updating the datasource. The same implementation can be applied when adding rows to the datasource via the Add method. The DataGrid doesn't currently support adding and removing records via the UI so as long as your database and collection is updated accordingly and in sync then the grid will push updates automatically. cell-editing.zip
Hi Michael,
I am was looking for something out of the box Datagrid which supports adding/deleting a row from the UI. And yes I already have code which are ObeservableCollections which add/remove values from my entity types.
If you look at the Syncfusion Datagrid they support this feature quite well. Are you guys planning to add this feature in future release of Datagrid?