ConditionalRuleInfo record Pro

A user-configured conditional-formatting rule: »when this column's value [Op] [Value], style the cell (or the whole row)«.

Data-driven, so a UI can create, list and remove rules — unlike the code-declared StyleRule lambdas, which stay untouched.

public sealed record ConditionalRuleInfo
Namespace
ArionUI.Formatting
Package
ArionUI.Formatting · dotnet add package ArionUI.Formatting --prerelease

Remarks

ConditionalRuleInfo.Id is assigned by the grid when the rule is added (0 = not yet added) and makes the rule addressable for the manager dialog: update, remove and reorder target a rule by its id. For scale kinds (ConditionalStyleKind.DataBar/ColorScale…) ConditionalRuleInfo.Op and ConditionalRuleInfo.Value are unused; ConditionalRuleInfo.Background is the bar/min color, ConditionalRuleInfo.Color2 the max (or mid) color, ConditionalRuleInfo.Color3 the max color of a 3-color scale. Scale rules need a numeric column (one with a summary value projection).

Constructors

ConditionalRuleInfo

public ConditionalRuleInfo(int ElementId, FilterOperator Op, string Value, Rgba? Background, Rgba? Foreground, bool Bold, bool WholeRow, int Id = 0, ConditionalStyleKind Kind = default, Rgba? Color2 = default, Rgba? Color3 = default, ConditionalCondition Condition = default);

A user-configured conditional-formatting rule: »when this column's value [Op] [Value], style the cell (or the whole row)«.

Data-driven, so a UI can create, list and remove rules — unlike the code-declared StyleRule lambdas, which stay untouched.

Remarks

ConditionalRuleInfo.Id is assigned by the grid when the rule is added (0 = not yet added) and makes the rule addressable for the manager dialog: update, remove and reorder target a rule by its id. For scale kinds (ConditionalStyleKind.DataBar/ColorScale…) ConditionalRuleInfo.Op and ConditionalRuleInfo.Value are unused; ConditionalRuleInfo.Background is the bar/min color, ConditionalRuleInfo.Color2 the max (or mid) color, ConditionalRuleInfo.Color3 the max color of a 3-color scale. Scale rules need a numeric column (one with a summary value projection).

Properties

Background

public Rgba? Background { get; init; }

Bold

public bool Bold { get; init; }

Color2

public Rgba? Color2 { get; init; }

Color3

public Rgba? Color3 { get; init; }

Condition

public ConditionalCondition Condition { get; init; }

ElementId

public int ElementId { get; init; }

Foreground

public Rgba? Foreground { get; init; }

Id

public int Id { get; init; }

Kind

public ConditionalStyleKind Kind { get; init; }

Op

public FilterOperator Op { get; init; }

Value

public string Value { get; init; }

WholeRow

public bool WholeRow { get; init; }