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. Image for the cookie policy date

DataGrid_SelectionChange

Hi, how can I get the column name of the rowselected?

1 Reply

DS Divakar Subramaniam Syncfusion Team August 22, 2016 07:25 AM UTC

Hi Miguel,   
   
Thank you for contacting Syncfusion Support.   
   
We have checked your query. You can get the column name of the cell you have selected by handling the SfDataGrid.GridTapped event. You can get the column index through GridTappedEventsArgs and by using the column index you can get the column name. Please refer the below code example.   
 
   
private int columnIndex;   
private string columnName;   
   
dataGrid.GridTapped += dataGrid_GridTapped;   
   
// Handling GripTapped event   
private void dataGrid_GridTapped(object sender, GridTappedEventsArgs e)   
{   
    columnIndex = this.DataGrid.ResolveToGridVisibleColumnIndex (e.RowColumnindex.ColumnIndex);   
    columnName = this.dataGrid.Columns[columnIndex].MappingName;   
}   
  
   
  
   
We have prepared a sample based on your requirement and you can download the same from the below link.   
 
 
Regards, 
Divakar. 


Loader.
Live Chat Icon For mobile
Up arrow icon