Table of Contents

Class NoxConditionalFormat

Namespace
Nox.Grid.WinForms
Assembly
Nox.Grid.WinForms.dll

Conditional formatting rule. Example: red background when the quantity column is greater than 100. NoxGrid1.ConditionalFormats.Add("colQty", NoxConditionOperator.GreaterThan, "100", Color.MistyRose). Rules are evaluated from the top; the colors and bold of the first matching rule win (StopIfTrue skips the remaining rules).

[TypeConverter(typeof(NoxConditionalFormatConverter))]
public class NoxConditionalFormat
Inheritance
NoxConditionalFormat
Inherited Members

Constructors

NoxConditionalFormat()

Creates an empty rule (set the column, operator and colors).

public NoxConditionalFormat()

NoxConditionalFormat(string, NoxConditionOperator, string, Color)

Creates a rule for a column with one value and a background color.

public NoxConditionalFormat(string columnName, NoxConditionOperator op, string value1, Color backColor)

Parameters

columnName string
op NoxConditionOperator
value1 string
backColor Color

NoxConditionalFormat(string, NoxConditionOperator, string, string, Color, Color)

Creates a rule for a column with two values (Between, NotBetween) and colors (Color.Empty keeps the cell color).

public NoxConditionalFormat(string columnName, NoxConditionOperator op, string value1, string value2, Color backColor, Color foreColor)

Parameters

columnName string
op NoxConditionOperator
value1 string
value2 string
backColor Color
foreColor Color

Properties

ApplyToRow

When the condition matches, formats the entire row instead of the cell. Default: False.

public bool ApplyToRow { get; set; }

Property Value

bool

BackColor

Background color when the condition matches.

public Color BackColor { get; set; }

Property Value

Color

Bold

Bold text when the rule matches.

public bool Bold { get; set; }

Property Value

bool

ColumnName

Name of the column whose value is tested. Empty means every column tests its own value. Default: empty.

public string ColumnName { get; set; }

Property Value

string

Enabled

Whether the rule is applied. Default: True.

public bool Enabled { get; set; }

Property Value

bool

ForeColor

Text color when the condition matches.

public Color ForeColor { get; set; }

Property Value

Color

Formula

Formula used when Operator = Formula (relative to the first row, e.g. =$D1>100). Default: empty.

public string Formula { get; set; }

Property Value

string

Italic

Italic text when the rule matches.

public bool Italic { get; set; }

Property Value

bool

MaxColor

ColorScale: color of the highest value.

public Color MaxColor { get; set; }

Property Value

Color

MidColor

ColorScale: color of the midpoint (empty for a two-color scale).

public Color MidColor { get; set; }

Property Value

Color

MinColor

ColorScale: color of the lowest value.

public Color MinColor { get; set; }

Property Value

Color

Operator

The kind of condition. Default: GreaterThan.

public NoxConditionOperator Operator { get; set; }

Property Value

NoxConditionOperator

StopIfTrue

When this rule matches, later rules are not evaluated. Default: False.

public bool StopIfTrue { get; set; }

Property Value

bool

Strikeout

Strikethrough. Default: False.

public bool Strikeout { get; set; }

Property Value

bool

Value1

Value to compare (number, date or text). Starting with = makes it a formula (e.g. =C1, relative to the first row). Default: empty.

public string Value1 { get; set; }

Property Value

string

Value2

The second value for Between and NotBetween. Default: empty.

public string Value2 { get; set; }

Property Value

string

Methods

ToString()

public override string ToString()

Returns

string