Back to Devexpress

IconSetFormatCondition Class

wpf-devexpress-dot-xpf-dot-grid-fc17e5db.md

latest5.0 KB
Original Source

IconSetFormatCondition Class

An Icon Sets conditional format.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public class IconSetFormatCondition :
    IndicatorFormatConditionBase
vb
Public Class IconSetFormatCondition
    Inherits IndicatorFormatConditionBase

Remarks

The Icon Sets conditional format allows you to use predefined or custom sets of icons to format different ranges of values.

The image below shows a grid column whose Profit cells contain icons corresponding to numeric values.

To create the Icon Sets conditional format in code, create the IconSetFormatCondition class instance and specify the following settings:

The following code sample illustrates how to define a conditional format in markup:

xaml
<dxg:TableView.FormatConditions>
   <dxg:IconSetFormatCondition FieldName="Profit" PredefinedFormatName="Stars3IconSet"/>
</dxg:TableView.FormatConditions>

The code sample below illustrates how to define the same conditional format in code-behind:

csharp
var profitFormatCondition = new IconSetFormatCondition() {
   FieldName = "Profit",
   PredefinedFormatName = "Stars3IconSet"
};
view.FormatConditions.Add(profitFormatCondition);
vb
Dim profitFormatCondition = New IconSetFormatCondition() With {
   .FieldName = "Profit",
   .PredefinedFormatName = "Stars3IconSet"
}
view.FormatConditions.Add(profitFormatCondition)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IconSetFormatCondition class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-data-grid-apply-conditional-formatting/CS/ConditionalFormatting/MainWindow.xaml#L30

xml
<dxg:DataBarFormatCondition FieldName="Profit" PredefinedFormatName="GreenGradientDataBar"/>
<dxg:IconSetFormatCondition FieldName="CustomersSatisfaction" PredefinedFormatName="Stars3IconSet"/>
<dxg:IconSetFormatCondition FieldName="MarketShare" PredefinedFormatName="Quarters5IconSet"/>

Inheritance

Object DispatcherObject DependencyObject FormatConditionBase IndicatorFormatConditionBase IconSetFormatCondition

See Also

IconSetFormatCondition Members

Conditional Formats

Formatting Values Using Icon Sets

DevExpress.Xpf.Grid Namespace