Skip to main content

TreeListView.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.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public ObservableCollection<ICustomItem> CompactModeFilterItems { get; }

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 TreeListView 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 TreeListView.CompactModeFilterItems property.

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

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

The compact panel can display filter items in the following modes, according to the TreeListView.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.

See Also