Skip to main content
All docs
V24.2

FormatConditionCollection.AddRange(IEnumerable<FormatConditionBase>) Method

Adds a range of conditional formats to the collection.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public void AddRange(
    IEnumerable<FormatConditionBase> conditionals
)

Parameters

Name Type Description
conditionals IEnumerable<FormatConditionBase>

A range of conditional formats.

Remarks

The following code sample adds conditional formats to the TableView.FormatConditions collection:

view.FormatConditions.AddRange(new List<FormatConditionBase> {
    new FormatCondition() { 
        FieldName = "ModelPrice", 
        ValueRule=ConditionRule.Greater, 
        Value1="50000", 
        PredefinedFormatName="LightRedFillWithDarkRedText" 
    },
    new IconSetFormatCondition () { 
        FieldName = "Discount", 
        PredefinedFormatName = "Stars3IconSet" 
    }
}); 

The collection contains the Add and AddRange methods to add conditional formats:

  • When you use the Add methods, each method call updates the GridControl. To improve performance of adding operations, enclose the changes within the BeginUpdate and EndUpdate method calls. In this case, the GridControl is updated after the last call.
  • When you use the AddRange method, the method call updates the GridControl after all conditional formats are added. You do not need to enclose the changes within the BeginUpdate and EndUpdate method calls.
See Also