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.
Unfortunately, activation email could not send to your email. Please try again.

DataGrid_SelectionChange

Thread ID:

Created:

Updated:

Platform:

Replies:

125502 Aug 20,2016 01:30 PM Aug 22,2016 03:25 AM Xamarin.Android 1
loading
Tags: SfDataGrid
Miguel Arenas
Asked On August 20, 2016 01:30 PM

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

Divakar Subramaniam [Syncfusion]
Replied On August 22, 2016 03:25 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;