Reading the cell information (or rows information) in WPF Toolkit Extended Community DataGrid for WPF? (System.Reflection.TargetInvocationException) Please help :)

 DataGrid dataGrid1 = sender as DataGrid; DataGridRow row = (DataGridRow)dataGrid1.ItemContainerGenerator.ContainerFromIndex(dataGrid1.SelectedIndex); DataGridCell RowColumn = dataGrid1.Columns[3].GetCellContent(row).Parent as DataGridCell; string myCellValue = ((TextBox)RowColumn.Content).Text; 

I used this in dataGrid1_selectionChanged event, I get this

An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

by ViiRuSxx via /r/csharp

Leave a Reply