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

FormatConditionFilterElement Class

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

Namespace: DevExpress.Xpf.Core.FilteringUI

Assembly: DevExpress.Xpf.Grid.v24.2.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