TableView.CompactModeFilterItems Property

Provides access to a collection of filter items displayed within a compact panel in compact mode.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.1.dll

Declaration

public ObservableCollection<ICustomItem> CompactModeFilterItems { get; }
Public ReadOnly Property CompactModeFilterItems As ObservableCollection(Of ICustomItem)

Property Value

Type Description
ObservableCollection<DevExpress.Xpf.Editors.ICustomItem>

A collection of filter items displayed within a compact panel in compact mode.

Remarks

The compact panel can display predefined filter items. When clicking a filter item, the GridControl displays only those items that meet the filter criteria. To add filters to the compact panel, pass a collection of filter items (instances of the CompactModeFilterItem class) to the TableView.CompactModeFilterItems property.

WPF_Grid_CompactMode_Filters

The code sample below demonstrates how to define a set of predefined filters.

<dxg:GridControl ItemsSource="{Binding Customers}">
    <dxg:GridControl.View>
        <dxg:TableView CompactPanelShowMode="CompactMode" SwitchToCompactModeWidth="400">
            <dxg:TableView.CompactModeFilterItems>
                <dxg:CompactModeFilterItem DisplayValue="All" EditValue="" />
                <dxg:CompactModeFilterItem DisplayValue="From London" EditValue="[City] = 'London'" />
                <dxg:CompactModeFilterItem DisplayValue="From Madrid" EditValue="[City] = 'Madrid'" />
            </dxg:TableView.CompactModeFilterItems>
            <dxg:TableView.DataRowCompactTemplate>
                <!-- data template -->
            </dxg:TableView.DataRowCompactTemplate>
        </dxg:TableView>
    </dxg:GridControl.View>
</dxg:GridControl>

The compact panel can display filter items in the following modes, according to the TableView.CompactFilterElementShowMode property value.

CompactFilterElementShowMode.Never

Compact panel does not display its filter items.

CompactFilterElementShowMode.List

Compact panel displays filter items as a separate list.

CompactFilterElementShowMode.ContextMenu

Compact panel displays its filter items in a separate menu.

CompactFilterElementShowMode.ContextMenuWithSorting

Compact panel merges filter items with the sort items in a single menu.

Implements

DevExpress.Xpf.Grid.ITableView.CompactModeFilterItems
See Also