WinForms › Tree List View › BinaryTreeListViewDatePickerCell
BinaryTreeListViewDatePickerCell
class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.TreeControls
A class that hosts the Binarymission's BinaryDatePicker control as its date editing control.
public class BinaryTreeListViewDatePickerCell : DataGridViewTextBoxCell
Inherits from / implements: DataGridViewTextBoxCell
Members at a glance
BinaryTreeListViewDatePickerCell | Constructs a new instance of the BinaryTreeListViewDatePickerCell class. |
DefaultNewRowValue | Gets the value this cell starts with on the grid's new-row placeholder. |
EditType | Gets the type of the control this cell uses for editing. |
ValueType | Gets the type of the value this cell holds. |
GetFormattedValue | Formats the cell's value for display, in the pattern and culture its column names. |
InitializeEditingControl | Prepares the editing control that this cell hands to the grid, pushing the cell's own settings onto it before editing starts. |
Paint | Paints this cell. The base implementation draws the standard cell; this override adds the parts specific to BinaryTreeListViewDatePickerCell. |
Constructors
BinaryTreeListViewDatePickerCell
public BinaryTreeListViewDatePickerCell() : base()
Constructs a new instance of the BinaryTreeListViewDatePickerCell class.
Properties
DefaultNewRowValue
public override object DefaultNewRowValue
Gets the value this cell starts with on the grid's new-row placeholder.
EditType
public override Type EditType
Gets the type of the control this cell uses for editing.
ValueType
public override Type ValueType
Gets the type of the value this cell holds.
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.
The column's
Format, CustomFormat and BinaryCultureInfo used to reach the editing control and nothing else, so every row that was not being edited showed its value as ToString() - a date with midnight after it, cut off in any column narrow enough to look right (HANDOVER 3av). A Format set on the cell's style still wins, as it does for any other cell.InitializeEditingControl
public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
Prepares the editing control that this cell hands to the grid, pushing the cell's own settings onto it before editing starts.
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 this cell. The base implementation draws the standard cell; this override adds the parts specific to BinaryTreeListViewDatePickerCell.
With
SpecialColumnCellsToDisplayEditingControlOnCellsAlways on, a row that is not being edited shows the picker's drop-down button beside its date: flat - a chevron, in a hairline box when the column's ShowBorderAlways is on - while DrawStyleIsFlat is on, and the classic themed push button otherwise (HANDOVER 3av).