HypernovaDesktop Components · docs
Binarymission
WinForms › Tree List View › BinaryTreeListViewNumericUpDownColumn

BinaryTreeListViewNumericUpDownColumn

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.TreeControls

A BinaryTreeListView column of numbers – quantities, percentages, prices – edited in a spinner and held within a range.

public class BinaryTreeListViewNumericUpDownColumn : DataGridViewColumn

Inherits from / implements: DataGridViewColumn

Remarks

Its cells are BinaryTreeListViewNumericUpDownCell and hold a decimal. Minimum, Maximum, Increment, DecimalPlaces and ThousandsSeparator apply to every cell in the column, including those already there.

The colour and border settings style the spinner while a cell is edited, and the chrome drawn on every row when BinaryTreeListView.SpecialColumnCellsToDisplayEditingControlOnCellsAlways is on. A colour left at Color.Empty gives the spinner its own default, which follows the Windows colour scheme; in the chrome on rows not being edited it leaves the button plate unfilled.

Examples

A percent-complete column in a project plan: whole numbers from 0 to 100, five at a click.

var progress = new BinaryTreeListViewNumericUpDownColumn
{
    HeaderText = "% done",
    Minimum = 0,
    Maximum = 100,
    Increment = 5,
    DecimalPlaces = 0
};
treeListView.Columns.Add(progress);

See also

Members at a glance

Constructors
BinaryTreeListViewNumericUpDownColumnCreates the column, with a BinaryTreeListViewNumericUpDownCell as its template: whole numbers from 0 to 100, stepped by 1.
Properties
BorderColorGets or sets the colour of the spinner's border while it is hot, and of the hairline box round the chrome on rows that are not being edited.
BorderStyleGets or sets the spinner's border style, which stays at BorderStyle.Fixed3D.
CellTemplateGets or sets the cell the column copies for each new row.
DecimalPlacesGets or sets how many decimal places the column's cells show and the spinner edits.
DrawStyleIsFlatGets or sets whether the spinner, and the chrome on rows not being edited, are drawn flat in the column's colours, or with the standard 3D look of a NumericUpDown.
IncrementGets or sets how much one click on a spin button, or one press of Up or Down, changes a value.
MaximumGets or sets the largest value a cell in the column can hold.
MinimumGets or sets the smallest value a cell in the column can hold.
ShowBorderAlwaysGets or sets whether the spinner's border and buttons are shown in their hot colours all the time, rather than only while the pointer is over it or it has the focus.
ThousandsSeparatorGets or sets whether the column's values are shown with the current culture's group separator, as in 12,500.
UpDownArrowPressedBackColorGets or sets the colour a spin button is filled with while it is held down.
UpDownArrowsColorGets or sets the colour of the up and down arrows, on the spinner and in the chrome drawn on rows that are not being edited.
UpDownButtonNormalBackColorGets or sets the colour the spin buttons are filled with at rest, and the colour of the button plate in the chrome drawn on rows that are not being edited.
UpDownButtonOnFocusBackColorGets or sets the colour the spin buttons are filled with while they are hot: while the pointer is over the spinner, while it has the focus, and always while ShowBorderAlways is set.
Methods
CloneCreates a copy of the column, including its colour and border settings. The range, increment and format travel with the copied cell template.
ToStringReturns a short description of the column, with its name and index.

Constructors

BinaryTreeListViewNumericUpDownColumn

public BinaryTreeListViewNumericUpDownColumn() : base(new BinaryTreeListViewNumericUpDownCell())

Creates the column, with a BinaryTreeListViewNumericUpDownCell as its template: whole numbers from 0 to 100, stepped by 1.

Properties

BorderColor

public Color BorderColor

Gets or sets the colour of the spinner's border while it is hot, and of the hairline box round the chrome on rows that are not being edited.

Value
The default is SystemColors.Highlight.
See also

BorderStyle

public BorderStyle BorderStyle

Gets or sets the spinner's border style, which stays at BorderStyle.Fixed3D.

Value
Always BorderStyle.Fixed3D: any other value is ignored. DrawStyleIsFlat is the setting that changes the look.

CellTemplate

public override DataGridViewCell CellTemplate

Gets or sets the cell the column copies for each new row.

Value
A BinaryTreeListViewNumericUpDownCell, or null.
Exceptions
InvalidCastException
The value is a cell of any other type.
Remarks

The range, increment and format settings of the column are stored on this template.

DecimalPlaces

public int DecimalPlaces

Gets or sets how many decimal places the column's cells show and the spinner edits.

Value
From 0 to 99. The default is 0.
Exceptions
ArgumentOutOfRangeException
The value is below 0 or above 99.
InvalidOperationException
The column has no CellTemplate.
Remarks

Setting it applies the value to the template and to every cell already in the column, then repaints the column and, if it sizes itself to its content, resizes it.

DrawStyleIsFlat

public bool DrawStyleIsFlat

Gets or sets whether the spinner, and the chrome on rows not being edited, are drawn flat in the column's colours, or with the standard 3D look of a NumericUpDown.

Value
true for the flat look; the default is true.
Remarks

While it is false none of the colour settings is used.

Increment

public Decimal Increment

Gets or sets how much one click on a spin button, or one press of Up or Down, changes a value.

Value
Zero or more. The default is 1.
Exceptions
ArgumentOutOfRangeException
The value is negative.
InvalidOperationException
The column has no CellTemplate.
Remarks

Setting it applies the value to the template and to every cell already in the column.

Maximum

public Decimal Maximum

Gets or sets the largest value a cell in the column can hold.

Value
The default is 100.
Exceptions
InvalidOperationException
The column has no CellTemplate.
Remarks

Setting it applies the value to the template and to every cell already in the column: a value above it is lowered to it, and a Minimum above it is lowered to match.

Minimum

public Decimal Minimum

Gets or sets the smallest value a cell in the column can hold.

Value
The default is 0.
Exceptions
InvalidOperationException
The column has no CellTemplate.
Remarks

Setting it applies the value to the template and to every cell already in the column: a value below it is raised to it, and a Maximum below it is raised to match.

ShowBorderAlways

public bool ShowBorderAlways

Gets or sets whether the spinner's border and buttons are shown in their hot colours all the time, rather than only while the pointer is over it or it has the focus.

Value
true to show them always; the default is false.
Remarks

It also decides whether the chrome on rows not being edited is drawn inside a hairline box in BorderColor. Used only while DrawStyleIsFlat is true.

See also

ThousandsSeparator

public bool ThousandsSeparator

Gets or sets whether the column's values are shown with the current culture's group separator, as in 12,500.

Value
true to group the digits; the default is false.
Exceptions
InvalidOperationException
The column has no CellTemplate.
Remarks

Setting it applies the value to the template and to every cell already in the column, then repaints the column.

UpDownArrowPressedBackColor

public Color UpDownArrowPressedBackColor

Gets or sets the colour a spin button is filled with while it is held down.

Value
The default is Color.Empty, which gives the spinner's own default: a strong shade of the Windows highlight colour.
See also

UpDownArrowsColor

public Color UpDownArrowsColor

Gets or sets the colour of the up and down arrows, on the spinner and in the chrome drawn on rows that are not being edited.

Value
The default is SystemColors.ControlText.

UpDownButtonNormalBackColor

public Color UpDownButtonNormalBackColor

Gets or sets the colour the spin buttons are filled with at rest, and the colour of the button plate in the chrome drawn on rows that are not being edited.

Value
The default is Color.Empty: the spinner uses SystemColors.Control, and the chrome leaves the plate unfilled.
See also

UpDownButtonOnFocusBackColor

public Color UpDownButtonOnFocusBackColor

Gets or sets the colour the spin buttons are filled with while they are hot: while the pointer is over the spinner, while it has the focus, and always while ShowBorderAlways is set.

Value
The default is Color.Empty, which gives the spinner's own default: a pale tint of the Windows highlight colour.
Remarks

The spinner has the focus for as long as a cell is being edited, so this is the button colour normally seen while editing.

See also

Methods

Clone

public override object Clone()

Creates a copy of the column, including its colour and border settings. The range, increment and format travel with the copied cell template.

Returns

ToString

public override string ToString()

Returns a short description of the column, with its name and index.

Returns

Text of the form BinaryTreeListViewNumericUpDownColumn { Name=Progress, Index=3 }.