Class NoxGridCheckBoxColumn
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
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
DefaultAlignment
Alignment of a new column of this kind.
protected override HorizontalAlignment DefaultAlignment { get; }
Property Value
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
DefaultWidth
Width of a new column of this kind.
protected override int DefaultWidth { get; }
Property Value
FalseValue
Value stored when unchecked (empty for False). Example: N. Default: Nothing.
[TypeConverter(typeof(StringConverter))]
public object FalseValue { get; set; }
Property Value
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
HeaderCheckState
State of the header check box over the shown rows (Checked, Indeterminate or Unchecked).
[Browsable(false)]
public CheckState HeaderCheckState { get; }
Property Value
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
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
TrueValue
Value stored when checked (empty for True). Example: Y. Default: Nothing.
[TypeConverter(typeof(StringConverter))]
public object TrueValue { get; set; }
Property Value
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
Methods
FormatValue(object)
Converts a value to display text.
public override string FormatValue(object value)
Parameters
valueobject
Returns
GetValue(bool, Type)
Value to store for the check state (Boolean for a bool data source)
public object GetValue(bool isChecked, Type targetType)
Parameters
Returns
IsChecked(object)
Whether the value is in the checked state
public bool IsChecked(object value)
Parameters
valueobject
Returns
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)