New to Telerik UI for WinUI? Download free 30-day trial

CellDoubleTap Command

The CellDoubleTap command handles the double tap gesture over a grid cell. The default implementation will attempt to enter edit mode.

Execution Parameter

The execution parameter is of type DataGridCellInfo and exposes the following properties:

  • Column—Gets the DataGridColumn instance with which the cell is associated.
  • Item—Gets the underlying data row (ViewModel instance) with which the cell is associated.

Custom CellDoubleTap Command

The following examples show how to create a class that inherits from the DataGridCommand and add it to the Commands collection.

Create a custom CellDoubleTap Command

public class CustomCellDoubleTapped : DataGridCommand 
{ 
    public CustomCellDoubleTapped() 
    { 
        this.Id = CommandId.CellDoubleTap; 
    } 
 
    public override bool CanExecute(object parameter) 
    { 
        var context = parameter as DataGridCellInfo; 
        // put your custom logic here 
        return true; 
    } 
 
    public override void Execute(object parameter) 
    { 
        var context = parameter as DataGridCellInfo; 
        // put your custom logic here 
 
        this.Owner.CommandService.ExecuteDefaultCommand(CommandId.CellDoubleTap, context); 
    } 
} 

Add the Custom Command to the Commands Collection

<Grid xmlns:grid="using:Telerik.UI.Xaml.Controls.Grid"> 
    <grid:RadDataGrid Width="600" Height="460" x:Name="grid" Hold> 
        <grid:RadDataGrid.Commands> 
             <local:CustomCellDoubleTapped/> 
        </grid:RadDataGrid.Commands> 
    </grid:RadDataGrid> 
</Grid> 

See Also

In this article
Not finding the help you need?