CellValue of CurrentCell is accessed by using CurrentCellActivated event. This event is triggered when CurrentCell is activated and whenever CurrentCell is moved. This event receives two arguments: sender and CurrentCellActivatedEventArgs.
The CurrentCellActivatedEventArgs objects has following properties,
Current RowIndex and ColumnIndex is accessed by using CurrentRowColumnIndex property. The ColumnIndex is resolved by using ResolveToGridVisibleColumnIndex method and you can get the MappingName with the ColumnIndex. RecordIndex is resolved by using current RowIndex and Current row record is accessed with the RecordIndex. While grouping, you can get current record by using DataGrid.View.TopLevelGroup.DisplayElements method. Refer the following code example.
Note: For WinRT and UWP, refer the following code example.
The current cell value is captured from current row and displayed in the TextBlock. The following screenshot displays the cell value in TextBlock.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|