BinaryTreeListViewNumericUpDownColumn
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 | |
|---|---|
BinaryTreeListViewNumericUpDownColumn | Creates the column, with a BinaryTreeListViewNumericUpDownCell as its template: whole numbers from 0 to 100, stepped by 1. |
| Properties | |
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. |
BorderStyle | Gets or sets the spinner's border style, which stays at BorderStyle.Fixed3D. |
CellTemplate | Gets or sets the cell the column copies for each new row. |
DecimalPlaces | Gets or sets how many decimal places the column's cells show and the spinner edits. |
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. |
Increment | Gets or sets how much one click on a spin button, or one press of Up or Down, changes a value. |
Maximum | Gets or sets the largest value a cell in the column can hold. |
Minimum | Gets or sets the smallest value a cell in the column can hold. |
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. |
ThousandsSeparator | Gets or sets whether the column's values are shown with the current culture's group separator, as in 12,500. |
UpDownArrowPressedBackColor | Gets or sets the colour a spin button is filled with while it is held down. |
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. |
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. |
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. |
| Methods | |
Clone | Creates a copy of the column, including its colour and border settings. The range, increment and format travel with the copied cell template. |
ToString | Returns a short description of the column, with its name and index. |
Constructors
BinaryTreeListViewNumericUpDownColumn
Creates the column, with a BinaryTreeListViewNumericUpDownCell as its template: whole numbers from 0 to 100, stepped by 1.
Properties
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
Gets or sets the spinner's border style, which stays at BorderStyle.Fixed3D.
- Value
- Always
BorderStyle.Fixed3D: any other value is ignored.DrawStyleIsFlatis the setting that changes the look.
CellTemplate
Gets or sets the cell the column copies for each new row.
- Value
- A
BinaryTreeListViewNumericUpDownCell, ornull.
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
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
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
truefor the flat look; the default istrue.
Remarks
While it is false none of the colour settings is used.
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
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
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
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
trueto show them always; the default isfalse.
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
Gets or sets whether the column's values are shown with the current culture's group separator, as in 12,500.
- Value
trueto group the digits; the default isfalse.
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
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
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
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 usesSystemColors.Control, and the chrome leaves the plate unfilled.
See also
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
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
Returns a short description of the column, with its name and index.
Returns
Text of the form BinaryTreeListViewNumericUpDownColumn { Name=Progress, Index=3 }.