FormatConditionRuleMinMaxBase.MaximumType Property
Gets or sets whether the target range’s maximum is automatically calculated or specified manually (as a number or percentage).
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
Declaration
[DefaultValue(FormatConditionValueType.Automatic)]
[DXCategory("Behavior")]
[XtraSerializableProperty]
public FormatConditionValueType MaximumType { get; set; }
Property Value
Type | Default | Description |
---|---|---|
FormatConditionValueType | Automatic | A value that specifies how the maximum of the target range is defined. |
Available values:
Name | Description |
---|---|
Number | Cell values are compared with zero. |
Percent | Cell values are compared with each other. The minimum cell value is treated as 0%, the maximum value is 100%. |
Automatic | A cuttoff/minimum/maximum value is calculated automatically.
|
Remarks
If the MaximumType
property is set to FormatConditionValueType.Automatic
, the range’s maximum value is calculated automatically.
With the FormatConditionRuleMinMaxBase.AutomaticType property, you can choose between two calculation modes: Default/ValueBased and ZeroBased. The effect produced by these modes on the range’s maximum value is noticeable when a column contains only negative values.
If the FormatConditionRuleMinMaxBase.AutomaticType property is set to
Default
orValueBased
, the range’s maximum value is the highest column value.In the image below, notice that a cell with the highest value (-5) has no visible data bar.
If the FormatConditionRuleMinMaxBase.AutomaticType property is set to
ZeroBased
, the range’s maximum value cannot be less than 0, and it is calculated according to the formula:MaximumValue = Math.Max(0, highestColumnValue)
The image below shows the same data (as in the previous image). A cell with the highest value has a visible data bar, since the maximum value now evaluates to zero.
In FormatConditionValueType.Number
and FormatConditionValueType.Percent
modes, the maximum value is specified by the FormatConditionRuleMinMaxBase.Maximum property.
If the MaximumType
property is set to Number
, the FormatConditionRuleMinMaxBase.Maximum property value is regarded as a numeric value.
If the MaximumType
property is set to Percent
, the FormatConditionRuleMinMaxBase.Maximum property specifies a percentage of the difference between the highest and lowest column values.
minValue + (maxValue - minValue) * (Maximum/100)
For example, the minimum value in a data source filed equals to 200 and the maximum value equals to 300. The Maximum
property set to 80 (80%) means that the maximum value is 280:
200 + (300 - 200) * (80/100) = 280