Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public class CheckedListFilterElement :
    FilterElement

#Remarks

Tip

Topic: Filter Elements

#Overview

Run Demo: Checked List

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

Run Demo: Checked List - Grid Template

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

Run Demo: Checked List - Chart Template

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.

Run Demo: Checked List

<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.

Run Demo: Checked List

<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