I m working with WPF DataGrid and I want to retrieve a DataGridCell‘s value by using the column and the row indexes : all what I could do is this but it didn’t work :
myDatGrid.Columns[0].GetCellContent((DataGridRow)myDatGrid.Items[0]);
Could you please show me the way to realize that
Your cells value is going to be contingent on what the given column is bound to. The entire row will be the instance of your model.
Assume we have a collection of
Personclasses which we are binding to within ourDataGrid.The
Contentproperty is going to return the underlying model for the row. If you wanted to obtain a given property you can do so by directly accessing the underyling object which should implementINotifyPropertyChanged, no need to fool with theDataGridas you would in a WinForms application.