FormatConditionCollection.AddRange(IEnumerable<FormatConditionBase>) Method
Adds a range of conditional formats to the collection.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddRange(IEnumerable<FormatConditionBase>) method.
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.