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

BinaryTreeListViewDatePickerCell

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

The cell of a BinaryTreeListViewDatePickerColumn: shows a date in the column's format and edits it with a drop-down calendar.

public class BinaryTreeListViewDatePickerCell : DataGridViewTextBoxCell

Inherits from / implements: DataGridViewTextBoxCell

Remarks

The column creates its cells, and its settings apply to all of them.

Members at a glance

Constructors
BinaryTreeListViewDatePickerCellCreates a date cell. A BinaryTreeListViewDatePickerColumn creates its cells itself.
Properties
DefaultNewRowValueGets the value shown in the grid's row for new entries: the current date and time. A tree list view has no such row.
EditTypeGets the type of the editor the grid creates for this cell: the column's date picker editor.
ValueTypeGets the type of the cell's value: object, so that it can hold a DateTime or the text the editor stores.
Methods
GetFormattedValueFormats the cell's value for display, in the pattern and culture its column names.
InitializeEditingControlPrepares the editor for this cell as editing starts, setting its date from the cell's value.
PaintPaints the cell: its date, and the picker's drop-down button when the grid shows the editors' chrome.

Constructors

BinaryTreeListViewDatePickerCell

public BinaryTreeListViewDatePickerCell() : base()

Creates a date cell. A BinaryTreeListViewDatePickerColumn creates its cells itself.

Properties

DefaultNewRowValue

public override object DefaultNewRowValue

Gets the value shown in the grid's row for new entries: the current date and time. A tree list view has no such row.

EditType

public override Type EditType

Gets the type of the editor the grid creates for this cell: the column's date picker editor.

ValueType

public override Type ValueType

Gets the type of the cell's value: object, so that it can hold a DateTime or the text the editor stores.

Methods

GetFormattedValue

protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, System.ComponentModel.TypeConverter valueTypeConverter, System.ComponentModel.TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)

Formats the cell's value for display, in the pattern and culture its column names.

Remarks

A DateTime, or text that reads as a date, is written with the column's BinaryTreeListViewDatePickerColumn.Format, BinaryTreeListViewDatePickerColumn.CustomFormat and BinaryTreeListViewDatePickerColumn.BinaryCultureInfo, on every row. A Format set on the cell's style still wins, as it does for any other cell, and any other value is formatted by the grid.

InitializeEditingControl

public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)

Prepares the editor for this cell as editing starts, setting its date from the cell's value.

Parameters
rowIndex
The row of the cell.
initialFormattedValue
The value as shown in the cell.
dataGridViewCellStyle
The cell's style.
Remarks

A cell with no value opens the editor empty. A value that does not read as a date opens it at the current date and time.

Paint

protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)

Paints the cell: its date, and the picker's drop-down button when the grid shows the editors' chrome.

Remarks

With BinaryTreeListView.SpecialColumnCellsToDisplayEditingControlOnCellsAlways on, a row that is not being edited shows the drop-down button beside its date: flat – a chevron, in a hairline box when the column's BinaryTreeListViewDatePickerColumn.ShowBorderAlways is on – while BinaryTreeListViewDatePickerColumn.DrawStyleIsFlat is on, and the classic themed push button otherwise.