Back to Devexpress

FormatRuleBase.Rule Property

windowsforms-devexpress-dot-xtraeditors-dot-formatrulebase.md

latest3.8 KB
Original Source

FormatRuleBase.Rule Property

Gets or sets the style format rule, which defines the condition and appearance settings applied when the condition is true.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue, 1000)]
[DXCategory("Appearance")]
public FormatConditionRuleBase Rule { get; set; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue, 1000)>
<DXCategory("Appearance")>
Public Property Rule As FormatConditionRuleBase

Property Value

TypeDescription
FormatConditionRuleBase

The style format rule.

|

Remarks

Note

A single FormatConditionRuleBase object cannot be shared between multiple FormatRuleBase objects.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Rule 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.

winforms-grid-bind-to-business-objects/CS/GridBoundToRuntimeCreatedData/Form1.cs#L43

csharp
formatConditionRuleValue.Value1 = DateTime.Today;
gridFormatRule.Rule = formatConditionRuleValue;
gridFormatRule.ApplyToRow = false;

winforms-pivot-grid-apply-format-rules-to-data-cells/CS/WinFormsPivotGridFormatRules/Form1.cs#L20

csharp
// Creates a new Rule object and sets its parameters.
newRule.Rule = new FormatConditionRuleDataBar{
    PredefinedName = "Yellow Gradient"

winforms-grid-bind-to-business-objects/VB/GridBoundToRuntimeCreatedData/Form1.vb#L45

vb
formatConditionRuleValue.Value1 = Date.Today
gridFormatRule.Rule = formatConditionRuleValue
gridFormatRule.ApplyToRow = False

winforms-pivot-grid-apply-format-rules-to-data-cells/VB/WinFormsPivotGridFormatRules/Form1.vb#L20

vb
' Creates a new Rule object and sets its parameters.
newRule.Rule = New FormatConditionRuleDataBar With {.PredefinedName = "Yellow Gradient"}
' Adds the rule to the collection.

See Also

FormatRuleBase Class

FormatRuleBase Members

DevExpress.XtraEditors Namespace