Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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

    FormatConditionFilterElement Class

    A filter element that works with a column’s Conditional Formatting Filters.

    Namespace: DevExpress.Xpf.Core.FilteringUI

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

    NuGet Package: DevExpress.Wpf.Grid.Core

    #Declaration

    public class FormatConditionFilterElement :
        FilterElement

    #Remarks

    Tip

    Topic: Filter Elements

    Run Demo: Conditional Formatting Filters

    Use the TableView.FormatConditions / TreeListView.FormatConditions property to define conditional formatting rules:

    <dxg:GridControl x:Name="grid">
        <dxg:GridControl.View>
            <dxg:TableView>
                <dxg:TableView.FormatConditions>
                    <dxg:TopBottomRuleFormatCondition FieldName="UnitPrice" Rule="TopPercent" 
                        Threshold="10" PredefinedFormatName="LightRedFillWithDarkRedText" />
                    <dxg:TopBottomRuleFormatCondition FieldName="UnitPrice" Rule="BelowAverage" 
                        Threshold="10" PredefinedFormatName="YellowFillWithDarkYellowText" />
                    <dxg:FormatCondition FieldName="Discount" ValueRule="Greater" 
                        Value1="0" PredefinedFormatName="GreenFillWithDarkGreenText" ApplyToRow="True" />
                </dxg:TableView.FormatConditions>            
            </dxg:TableView>
        </dxg:GridControl.View>
    </dxg:GridControl>
    

    The FormatConditionFilterElement allows a user to apply a filter based on a colum’s conditional formatting rules:

    <dxg:GridControl x:Name="grid" ... />
    <!-- ... -->
    <dxfui:FormatConditionFilterElement FieldName="UnitPrice" Context="{Binding FilteringContext, ElementName=grid}"/>
    
    See Also