Skip to main content
A newer version of this page is available. .

CheckedListFilterElement Class

A checked list filter element that allows a user to select multiple filter values from a set.

Namespace: DevExpress.Xpf.Core.FilteringUI

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

Declaration

public class CheckedListFilterElement :
    FilterElement

Remarks

Tip

Topic: Filter Elements

Overview

Tip

Demo: Checked List

Requires a WPF Subscription. Download

The image below shows a checked list filter element:

<dxg:GridControl x:Name="grid" ... />
<!-- ... -->
<dxfui:CheckedListFilterElement Context="{Binding FilteringContext, ElementName=grid}" FieldName="TrademarkID" /> 

FilterModelTemplate Property

Use the FilterElement.FilterModelTemplate property to specify the filter element template.

Tip

Data Context (Binding Source): CheckedListFilterModel

Grid Template

Tip

Demo: Checked List - Grid Template

Requires a WPF Subscription. Download

Code Sample
<dxfui:CheckedListFilterElement x:Name="filterElement"
                                FieldName="Country" Context="{Binding ElementName=grid, Path=FilteringContext}">
    <dxfui:CheckedListFilterElement.FilterModelTemplate>
        <DataTemplate>
            <dxg:GridControl SelectionMode="MultipleRow"
                             ItemsSource="{Binding FilterValues}" SelectedItems="{Binding SelectedFilterValuesSource}">
                <dxg:GridControl.Columns>
                    <dxg:GridColumn FieldName="Row.Flag" Header="Flag" Width="30">
                        <dxg:GridColumn.CellTemplate>
                            <DataTemplate>
                                <Image Source="{Binding Value}" HorizontalAlignment="Center" Height="20"/>
                            </DataTemplate>
                        </dxg:GridColumn.CellTemplate>
                    </dxg:GridColumn>
                    <dxg:GridColumn FieldName="Value" Width="*"/>
                    <dxg:GridColumn FieldName="Count" SortOrder="Descending" Width="60"/>
                </dxg:GridControl.Columns>
                <dxg:GridControl.View>
                    <dxg:TableView ShowCheckBoxSelectorColumn="True" CheckBoxSelectorColumnWidth="30" NavigationStyle="Row"
                                   ShowGroupPanel="False" AllowGrouping="False" ShowIndicator="False" AllowEditing="False">
                        <dxg:TableView.FormatConditions>
                            <dxg:DataBarFormatCondition FieldName="Value" Expression="[Count]" PredefinedFormatName="GreenSolidDataBar"/>
                        </dxg:TableView.FormatConditions>
                    </dxg:TableView>
                </dxg:GridControl.View>
            </dxg:GridControl>
        </DataTemplate>
    </dxfui:CheckedListFilterElement.FilterModelTemplate>
</dxfui:CheckedListFilterElement> 

Chart Template

Tip

Demo: Checked List - Chart Template

Requires a WPF Subscription. Download

Code Sample
<dxfui:CheckedListFilterElement x:Name="filterElement"
                                FieldName="Country" Context="{Binding ElementName=grid, Path=FilteringContext}"
                                ShowAllLookUpFilterValues="False">
    <dxfui:CheckedListFilterElement.FilterModelTemplate>
        <DataTemplate>
            <dxc:ChartControl DataSource="{Binding FilterValues}"
                              SelectedItems="{Binding SelectedFilterValuesSource}"
                              SelectionMode="Multiple" Padding="4">
                <dxc:ChartControl.CrosshairOptions>
                    <dxc:CrosshairOptions ShowArgumentLine="False"/>
                </dxc:ChartControl.CrosshairOptions>
                <dxc:XYDiagram2D>
                    <dxc:XYDiagram2D.AxisX>
                        <dxc:AxisX2D>
                            <dxc:AxisX2D.WholeRange>
                                <dxc:Range SideMarginsValue="1.0"/>
                            </dxc:AxisX2D.WholeRange>
                            <dxc:AxisX2D.QualitativeScaleOptions>
                                <dxc:QualitativeScaleOptions AutoGrid="False"/>
                            </dxc:AxisX2D.QualitativeScaleOptions>
                            <dxc:AxisX2D.Label>
                                <dxc:AxisLabel Angle="-90">
                                    <dxc:Axis2D.ResolveOverlappingOptions>
                                        <dxc:AxisLabelResolveOverlappingOptions AllowRotate="False" AllowStagger="False" AllowHide="False"/>
                                    </dxc:Axis2D.ResolveOverlappingOptions>
                                </dxc:AxisLabel>
                            </dxc:AxisX2D.Label>
                        </dxc:AxisX2D>
                    </dxc:XYDiagram2D.AxisX>
                    <dxc:BarSideBySideSeries2D ArgumentDataMember="Row.ActualNWindName" ValueDataMember="Count"/>
                </dxc:XYDiagram2D>
            </dxc:ChartControl>
        </DataTemplate>
    </dxfui:CheckedListFilterElement.FilterModelTemplate>
</dxfui:CheckedListFilterElement> 

ShowCounts Property

The CheckedListFilterElement shows the record count next to filter values:

Set the FilterElement.ShowCounts property to false to not show counts.

Tip

Demo: Checked List

Requires a WPF Subscription. Download

<dxfui:CheckedListFilterElement x:Name="filterElement" FieldName="Country"
                                Context="{Binding ElementName=grid, Path=FilteringContext}" />
<CheckBox IsChecked="{Binding ElementName=filterElement, Path=SelectAllWhenFilterIsNull}"
          Content="Select All When Filter Is Null" />
<CheckBox IsChecked="{Binding ElementName=filterElement, Path=ShowCounts}"
          Content="Show Counts" /> 

SelectAllWhenFilterIsNull Property

Use the SelectAllWhenFilterIsNull property to specify whether to select all filter values when the filter is null.

Tip

Demo: Checked List

Requires a WPF Subscription. Download

<dxfui:CheckedListFilterElement x:Name="filterElement" FieldName="Country"
                                Context="{Binding ElementName=grid, Path=FilteringContext}" />
<CheckBox IsChecked="{Binding ElementName=filterElement, Path=SelectAllWhenFilterIsNull}"
          Content="Select All When Filter Is Null" />
<CheckBox IsChecked="{Binding ElementName=filterElement, Path=ShowCounts}"
          Content="Show Counts" /> 
See Also