Observablecollection not updating datagrid
In Data Grid, every Cell is in the form of Text Block Framework Element type when it is not editable.So to read the edited cell value, you need to read the Cell contents using ‘Get Cell Content()’ method, by passing the Data Grid Row object to it.Run the application and try to edit the column "Status", you would get Combo Box control to handle the Status List.And when in Edit mode: After Updating: Hope this article helps.When the particular cell will be edit mode, we would be able to select from the list displayed in the Combo Box. Now we will add a Data Grid to the Window and design the Columns inside of it.We need to set the Item Source Property; for that I have created a Class that would generate the list and in XAML I have accessed it and assigned it.This code first searches the selected Employee row using LINQ.After the row is found, the update operation is performed on it.
Here ‘Salary’ and ‘Dept No’ are changed and updated into the selected ‘Employee’ object.
How do I create this kind of data Grid dynamically?