Back to Devexpress

DataGridView.Tap Event

mobilecontrols-devexpress-dot-xamarinforms-dot-datagrid-dot-datagridview.md

latest3.8 KB
Original Source

DataGridView.Tap Event

Occurs when a user taps the grid.

Namespace : DevExpress.XamarinForms.DataGrid

Assembly : DevExpress.XamarinForms.Grid.dll

NuGet Package : DevExpress.XamarinForms.Grid

Declaration

csharp
public event DataGridGestureEventHandler Tap

Event Data

The Tap event's data class is DataGridGestureEventArgs. The following properties provide information specific to this event:

PropertyDescription
ElementGets the value that specifies the grid element with which a user interacts.
FieldNameGets the field name of the column.
ItemGets an object that specifies a data source’s item to which the grid’s data row corresponds.
RowHandleGets the grid’s row handle. Inherited from RowEventArgs.

Remarks

The DataGridView raises the following events in response to user gestures:

|

Gesture

|

Event

| | --- | --- | |

Tap

|

Tap and TapConfirmed

| |

Double Tap

|

Tap and DoubleTap

| |

LongPress

|

LongPress

|

The event parameter’s Element property allows you to obtain the element that was tapped.

If a user interacts with a data row, the Item property returns the data source’s item object that corresponds to the row. To obtain the tapped row handle, use the RowHandle property. If a user taps a data row that is not selected, the DataGridView.SelectionChanged event is also raised.

Example

This example shows how to set up the grid to display the Edit Values form when a user taps a cell. The grid is bound to a collection of orders.

  1. Subscribe to the DataGridView.Tap event.

  2. In the event handler:

  3. In the App.xaml.cs file, assign a NavigationPage instance to the Application.MainPage property and add the MainPage content page to the navigation stack (the application’s root page):

The grid now displays the Edit Values form when a user taps a data cell.

View Example

See Also

DataGridView Class

DataGridView Members

DevExpress.XamarinForms.DataGrid Namespace