.NET MAUI DataGrid CellTap Command
The DataGrid CellTap
command handles the tap (click) gesture over a grid cell, that is, the intersection of a data row and a column.
Example
Here is an example how the .NET MAUI DataGrid CellTap
command works:
1. Create the needed business objects, for example, type Country
with the following properties:
2. Add data to the DataGrid
ItemsSource
and set the BindingContext
:
3. Handle the CellTap
action as a command. First, create a class that inherits from the DataGridCommand
and set its Id
property. You will also need to override the CanExecute
and Execute
methods as demonstrated in the example below:
4. Add this command to the Commands
collection of the RadDataGrid
instance:
5. Define the DataGrid in XAML:
6. Add the telerik
namespace: