You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

FormatConditionCollection Class

A collection of conditional formats.

Namespace: DevExpress.Xpf.Grid

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

Declaration

public class FormatConditionCollection :
    ObservableCollectionCore<FormatConditionBase>
Public Class FormatConditionCollection
    Inherits ObservableCollectionCore(Of FormatConditionBase)

Related API Members

The following members accept/return FormatConditionCollection objects:

Remarks

The TableView.FormatConditions / TreeListView.FormatConditions collection stores conditional formatting rules applied to the grid's view.

Use the following methods to add and remove conditional formatting rules.

The following code sample illustrates how to define a conditional formatting rule in markup. For more information, refer to the example: How to: Apply Conditional Formatting.

<dxg:TableView.FormatConditions>
   <dxg:DataBarFormatCondition FieldName="Visits" PredefinedFormatName="GreenGradientDataBar" />
</dxg:TableView.FormatConditions>

The code sample below illustrates how to define the same conditional formatting rule in code-behind. For more information, refer to How to: Apply Conditional Formatting in Code-Behind.

var visitsDataBar = new DataBarFormatCondition() {
   FieldName = "Visits",
   PredefinedFormatName = "GreenGradientDataBar"
};
view.AddFormatCondition(visitsDataBar);

Inheritance

Object
Collection<FormatConditionBase>
ObservableCollection<FormatConditionBase>
DevExpress.Xpf.Core.ObservableCollectionCore<FormatConditionBase>
FormatConditionCollection
See Also