Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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

    FormatConditionCollection.AddRange(IEnumerable<FormatConditionBase>) Method

    Adds a range of conditional formats to the collection.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v25.1.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