FilteringPanelControl.ElementClickCommand Property
Gets or sets a command executed when a user clicks a Filter Panel element. This is a dependency property.
Namespace: DevExpress.Xpf.Core.FilteringUI
Assembly: DevExpress.Xpf.Grid.v26.1.dll
Declaration
Property Value
| Type | Description |
|---|---|
| ICommand | A command executed when a user clicks a Filter Panel element. |
Remarks
Bind a command to the ElementClickCommand property to handle clicks on individual Filter Panel elements in a ViewModel. The command parameter is a FilterPanelElementClickEventArgs object that stores the following information:
- ColumnName
- Gets the field name associated with the clicked Filter Panel element.
- ElementType
- Gets the type of the clicked Filter Panel element.
- Value
- Gets the value or operator associated with the clicked Filter Panel element.
- ClickCount
- Gets the number of clicks on a Filter Panel element.
Example: Handle Filter Panel Element Clicks
The following code snippet handles clicks on filter field name and value elements to display a message:
<dx:ThemedWindow x:Class="FilterPanelExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui">
<dxg:GridControl ItemsSource="{Binding Orders}" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView ShowFilterPanel="True">
<dxg:TableView.FilteringPanelStyle>
<Style TargetType="dxfui:FilteringPanelControl">
<Setter Property="ElementClickCommand"
Value="{Binding DataContext.ElementClickCommandHandler,
RelativeSource={RelativeSource AncestorType=Window}}"/>
</Style>
</dxg:TableView.FilteringPanelStyle>
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
</dx:ThemedWindow>
See Also