Back to Devexpress

FormatConditionCollection Class

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

latest4.6 KB
Original Source

FormatConditionCollection Class

A collection of conditional formats.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

The following members 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:

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

View Example: Apply Conditional Formatting

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

csharp
var visitsDataBar = new DataBarFormatCondition() {
   FieldName = "Visits",
   PredefinedFormatName = "GreenGradientDataBar"
};
view.AddFormatCondition(visitsDataBar);
vb
Dim visitsDataBar = New DataBarFormatCondition() With {
   .FieldName = "Visits",
   .PredefinedFormatName = "GreenGradientDataBar"
}
view.AddFormatCondition(visitsDataBar)

View Example: Apply Conditional Formatting in Code Behind

Inheritance

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

See Also

AddRange

FormatConditionCollection Members

Conditional Formats

DevExpress.Xpf.Grid Namespace