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

FilterButtonTap Command

The FilterButtonTap command handles the tap gesture over a Filter button. The default implementation will open the Filtering Flyout.

Execution Parameter

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

  • AssociatedDescriptor—Gets the FilterDescriptorBase instance associated with the context. Typically, this is the PropertyFilterDescriptor already applied to the column instance.
  • FirstFilterControl—Gets or sets the IFilterControl control that represents the UI used to generate the first FilterDescriptorBase.
  • SecondFilterControl—Gets or sets the IFilterControl control that represents the UI used to generate the second FilterDescriptorBase.
  • Column—Gets the DataGridColumn instance that owns the Filter button that is being tapped.

Custom FilterButtonTap 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 FilterButtonTap Command

public class CustomFilterButtonTapCommand : DataGridCommand 
{ 
    public CustomFilterButtonTapCommand() 
    { 
        this.Id = CommandId.FilterButtonTap; 
    } 
 
    public override bool CanExecute(object parameter) 
    { 
        var context = parameter as FilterButtonTapContext; 
        // put your custom logic here 
        return true; 
    } 
 
    public override void Execute(object parameter) 
    { 
        var context = parameter as FilterButtonTapContext; 
        // put your custom logic here    
 
        this.Owner.CommandService.ExecuteDefaultCommand(CommandId.FilterButtonTap, 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:CustomFilterButtonTapCommand/> 
        </grid:RadDataGrid.Commands> 
    </grid:RadDataGrid> 
</Grid> 

See Also

In this article
Not finding the help you need?