PivotGridControl.FormatRules Property
Gets the collection of style format rules for a PivotGridControl.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.1.dll
NuGet Package: DevExpress.Win.PivotGrid
Declaration
[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true, 1000, XtraSerializationFlags.DefaultValue)]
[XtraSerializablePropertyId(6)]
[DXCategory("Data")]
public virtual PivotGridFormatRuleCollection FormatRules { get; }
Property Value
Type | Description |
---|---|
PivotGridFormatRuleCollection | A PivotGridFormatRuleCollection object which is the collection of style format rules. |
Remarks
The FormatRules property allows you to apply conditional formatting, which involves applying appearances to data cells that match the specified rules. This property provides access to the collection of PivotGridFormatRule objects containing style format rules.
The PivotGridFormatRule class exposes the following major members that allow you to apply conditional formatting to data cells.
- The PivotGridFormatRule.Measure property defines a data field to which the format rule is applied.
- The PivotGridFormatRule.Settings property specifies which data cells or field intersections are involved in conditional formatting. To define the PivotGridFormatRule.Settings property, create a new FormatRuleFieldIntersectionSettings or FormatRuleTotalTypeSettings class object and define its parameters. The FormatRuleFieldIntersectionSettings class object defines an intersection of row and column fields, and the FormatRuleTotalTypeSettings class object specifies the type of cells.
- The FormatRuleBase.Rule property specifies the style format rule, which defines a condition and appearance settings applied to data cells. To control the appearance of the Pivot Grid Control’s data cells, create the required FormatConditionRuleBase class descendant, specify its settings and assign this object to the FormatRuleBase.Rule property.
The following table lists supported PivotGridFormatRule.Settings settings for each rule.
Note
Note, that the FormatConditionRuleDateOccuring and FormatConditionRuleUniqueDuplicate rules are not in effect for the PivotGridControl.
To check whether the format rule is correct, use the PivotGridFormatRule.IsValid property. If this property returns true, the format rule specified with the PivotGridControl.FormatRules
property is applied to pivot data cells.
Note
Note that the PivotGridControl.CustomCellValue event does not affect format conditions defined using the FormatRules property.