Telerik UI for Windows 8 XAML

Handles the Tap gesture over a Filter Button. The default implementation will open the Filtering Flyout. The execution parameter is of type FilterButtonTapContext which exposes the following properties:

Important

The FilterButtonTap command allows to easily replace the First Filter Control and Second Filter Control. Thus, you can apply a completely different UI and also associate it with a different property of the Model. See an example.

  • 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 own the Filter Glyph Button being tapped.

This example creates a class that inherits from the DataGridCommand and then adds it to the RadDataGrid.Commands collection.

C# Copy imageCopy
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               
    }
}

Here is the XAML declaration:

XAML Copy imageCopy
<grid:RadDataGrid>
    <grid:RadDataGrid.Commands>
        <local:CustomFilterButtonTapCommand/>
    </grid:RadDataGrid.Commands>
</grid:RadDataGrid>