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 theFilterDescriptorBase
instance associated with the context. Typically, this is thePropertyFilterDescriptor
already applied to the column instance. -
FirstFilterControl
—Gets or sets theIFilterControl
control that represents the UI used to generate the firstFilterDescriptorBase
. -
SecondFilterControl
—Gets or sets theIFilterControl
control that represents the UI used to generate the secondFilterDescriptorBase
. -
Column
—Gets theDataGridColumn
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>