We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the Current Cell value when you click the cell?

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,

  • CurrentRowColumnIndex: Gets the value of the CurrentRowColumnIndex.
  • PreviousRowColumnIndex: Gets the value of the PreviousRowColumnIndex.
  • ActivationTrigger: Gets the trigger action of the current cell.

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.

C#

C:\Users\labuser\Desktop\note.jpgNote: For WinRT and UWP, refer the following code example.

C#

 

The current cell value is captured from current row and displayed in the TextBlock. The following screenshot displays the cell value in TextBlock.

F:\KB\Images\CurrentCellValue.png

Sample Links:

WPF

WinRT

SilverLight

UWP

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2446 08/06/2014 09/29/2016 WPF SfDataGrid 4.5 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon