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

How to get the column name on tapping a row in SfDataGrid?

Platform: Xamarin.Forms |
Control: SfDataGrid
Tags: grid_events

You can get the column name while tapping a row by using the SfDataGrid.GridTapped event. It provides the row column index in its argument. Thus, using the ColumnIndex you can get the column name of the tapped cell in SfDataGrid.

Refer the below code example in which the GridTapped event is hooked in SfDataGrid.

    <syncfusion:SfDataGrid x:Name ="dataGrid"
                           ItemsSource="{Binding OrdersInfo}"


The below code illustrates how to get the Column name of the tapped cell using the ColumnIndex obtained from the GridTapped event arguments and show it in a DisplayAlert.

private int columnIndex;
private string columnName;
private void DataGrid_GridTapped (object sender, GridTappedEventsArgs e)
    columnIndex = dataGrid.ResolveToGridVisibleColumnIndex(e.RowColumnindex.ColumnIndex);
    columnName = this.dataGrid.Columns[columnIndex].MappingName;
    DisplayAlert("Setected Column Name", columnName, "Cancel");


On executing the above code and tapping a cell in SfDataGrid, a DisplayAlert will be display the column Name as shown below.

Display Alert after executing code


Sample Link:

How to get the column name of the selected row?


2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile