Table of Contents

Class NoxGridCheckBoxColumn

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

Check box column. Values are Boolean by default; TrueValue/FalseValue allow values such as "Y"/"N".

public class NoxGridCheckBoxColumn : NoxGridColumn, IComponent, IDisposable
Inheritance
NoxGridCheckBoxColumn
Implements
Inherited Members

Constructors

NoxGridCheckBoxColumn()

Creates a check box column.

public NoxGridCheckBoxColumn()

NoxGridCheckBoxColumn(string, string)

Creates a check box column with a name and header text.

public NoxGridCheckBoxColumn(string name, string headerText)

Parameters

name string
headerText string

Properties

CheckedImage

Picture drawn for checked cells instead of the standard check box (null = standard). Drawn at its own size, centered, and shrunk to fit a smaller cell. The grid does not dispose it.

public Image CheckedImage { get; set; }

Property Value

Image

DefaultAlignment

Alignment of a new column of this kind.

protected override HorizontalAlignment DefaultAlignment { get; }

Property Value

HorizontalAlignment

DefaultSortMode

Check box columns do not sort on a header click by default (same as DataGridView). Set SortMode = Automatic to sort.

protected override NoxGridColumnSortMode DefaultSortMode { get; }

Property Value

NoxGridColumnSortMode

DefaultWidth

Width of a new column of this kind.

protected override int DefaultWidth { get; }

Property Value

int

FalseValue

Value stored when unchecked (empty for False). Example: N. Default: Nothing.

[TypeConverter(typeof(StringConverter))]
public object FalseValue { get; set; }

Property Value

object

HeaderCheckBox

Shows a check box in the column header that checks or unchecks every shown row (filtered and hidden rows are skipped). It shows a mixed state when only some rows are checked. Clicking the header toggles instead of sorting.

public bool HeaderCheckBox { get; set; }

Property Value

bool

HeaderCheckState

State of the header check box over the shown rows (Checked, Indeterminate or Unchecked).

[Browsable(false)]
public CheckState HeaderCheckState { get; }

Property Value

CheckState

ReadOnlyAppearance

How read-only cells of this column are drawn (column, row or cell ReadOnly, or a read-only grid). Disabled (default) grays them out; Normal draws them like editable check boxes, as DataGridView does. Either way they cannot be changed.

public NoxCheckReadOnlyAppearance ReadOnlyAppearance { get; set; }

Property Value

NoxCheckReadOnlyAppearance

ToggleWithModifierKeys

Clicking a cell with Ctrl or Shift held also toggles the check box, as in DataGridView (the selection is extended too). Default: False: Ctrl/Shift+click only extends the selection, so picking several rows does not change their check boxes.

public bool ToggleWithModifierKeys { get; set; }

Property Value

bool

TrueValue

Value stored when checked (empty for True). Example: Y. Default: Nothing.

[TypeConverter(typeof(StringConverter))]
public object TrueValue { get; set; }

Property Value

object

UncheckedImage

Picture drawn for unchecked cells instead of the standard check box (null = standard; with only CheckedImage set, unchecked cells are left empty)

public Image UncheckedImage { get; set; }

Property Value

Image

Methods

FormatValue(object)

Converts a value to display text.

public override string FormatValue(object value)

Parameters

value object

Returns

string

GetValue(bool, Type)

Value to store for the check state (Boolean for a bool data source)

public object GetValue(bool isChecked, Type targetType)

Parameters

isChecked bool
targetType Type

Returns

object

IsChecked(object)

Whether the value is in the checked state

public bool IsChecked(object value)

Parameters

value object

Returns

bool

ParseValue(string, Type)

Converts edited text to a value. targetType is determined in the order ValueType → data source type → existing value type. Throws FormatException if the text cannot be converted.

public override object ParseValue(string text, Type targetType)

Parameters

text string
targetType Type

Returns

object