GridDashboardItem.FormatRules Property
Provides access to format rules of the Grid dashboard item.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.1.Core.dll
NuGet Package: DevExpress.Dashboard.Core
Declaration
Property Value
Type | Description |
---|---|
GridItemFormatRuleCollection | A GridItemFormatRuleCollection object that is a collection of Grid format rules. |
Remarks
The Grid dashboard item allows you to apply conditional formatting to cells. The FormatRules property provides access to a collection of the GridItemFormatRule objects that are used to define formatting settings.
To add a new format rule, create the GridItemFormatRule object and specify the following settings.
- Create a required condition (the FormatConditionBase descendant), specify its settings and assign the resulting object to the DashboardItemFormatRule.Condition property.
- Set a measure/dimension whose values are checked using the specified condition by specifying the CellsItemFormatRule.DataItem property. The CellsItemFormatRule.DataItemApplyTo property specifies the measure/dimension to whose values a formatting should be applied.
- Optionally, enable the CellsItemFormatRule.ApplyToRow flag to apply formatting to the entire grid row.
Finally, add the created format rule to the FormatRules collection. You can use the DashboardItemFormatRule.Enabled property to specify whether the current format rule is enabled.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FormatRules property.
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.