BinaryTreeListViewDatePickerColumn
A column of dates, edited with a Binarymission BinaryDatePicker and its drop-down calendar.
public class BinaryTreeListViewDatePickerColumn : DataGridViewColumn
Inherits from / implements: DataGridViewColumn
Remarks
Give the cells DateTime values, or text that parses as a date. Every row shows its
date in the column's Format and BinaryCultureInfo; while
BinaryTreeListView.SpecialColumnCellsToDisplayEditingControlOnCellsAlways is on, it also
shows the picker's drop-down button. The calendar's colours, buttons and markers are set on the
column and copied to each cell's editor when editing starts.
A date the user picks is stored back in the cell as text – the date and time written in the
current culture's general format – so read it with ToDateTime() rather than a cast.
Examples
BinaryTreeListViewDatePickerColumn due = new BinaryTreeListViewDatePickerColumn
{
Name = "Due",
HeaderText = "Due",
Format = BinaryDatePickerFormat.Custom,
CustomFormat = "ddd d MMM yyyy",
TodayButtonText = "Today",
SelectionDateEllipseColor = Color.SteelBlue
};
plan.Columns.Add(due);
// Later, read a node's due date whichever way it was stored.
DateTime dueDate = Convert.ToDateTime(plan.CurrentNode.Cells["Due"].Value);See also
Members at a glance
| Constructors | |
|---|---|
BinaryTreeListViewDatePickerColumn | Creates a date column whose cells are BinaryTreeListViewDatePickerCell objects. |
| Properties | |
BinaryCultureInfo | Gets or sets the culture the column's dates are written in and its calendar is shown in – month and day names, and the first day of the week. |
BorderColor | Gets or sets the colour of the border round the date. |
CalendarForeColor | Gets or sets the colour of the calendar's dates and day names. |
CalendarInactiveDateForeColor | Gets or sets a colour for the days of the previous and next months shown in the calendar. |
CalendarLegendDisplay | Gets or sets whether the calendar shows a legend at its foot explaining the selected-date and today markers. |
CalendarMonthAndYearTrackerColor | Gets or sets the colour of the arrows either side of the calendar's month and year title, which move to the previous and next month. |
CalendarMonthBackColor | Gets or sets the background colour of the calendar. |
CalendarMonthTitleForeColor | Gets or sets the colour of the calendar's month and year title. |
CloseButtonBackColor | Gets or sets the background colour of the calendar's Close button. |
CloseButtonFlatStyle | Gets or sets the flat style of the calendar's Close button. |
CloseButtonForeColor | Gets or sets the text colour of the calendar's Close button. |
CloseButtonText | Gets or sets the caption of the calendar's button that closes it. |
CustomDropDownImage | Gets or sets a picture of your own for the editor's drop-down button. |
CustomFormat | Gets or sets the date pattern the column uses when Format is
BinaryDatePickerFormat.Custom. |
DotBorderDepth | Gets or sets the length of each dash of the editor's dotted border. |
DotBorderGap | Gets or sets the gap between the dashes of the editor's dotted border. |
DrawBorderAs | Gets or sets whether the editor's border is a continuous line or dotted. |
DrawStyleIsFlat | Gets or sets whether cells that are not being edited draw their drop-down button flat – a chevron,
inside a hairline box when ShowBorderAlways is on – or as the classic themed push
button. |
EditControlStyleIsExtended | Gets or sets whether the editor's date box has the extended border: one that appears on hover and
focus, can be dotted, and takes BorderColor. |
Format | Gets or sets how the column shows its dates: the culture's long or short date pattern, or
CustomFormat. |
MarkSelectedDate | Gets or sets whether the calendar marks the selected date and today's date with a filled circle. |
SelectionDateEllipseColor | Gets or sets the colour of the circle that marks the selected date in the calendar. |
SelectionDateForeColor | Gets or sets the colour of the selected date's number in the calendar. |
ShowBorderAlways | Gets or sets whether a border is drawn round the date at all times, rather than only while the pointer is over the editor or it has the focus. |
TodayButtonBackColor | Gets or sets the background colour of the calendar's Today button. |
TodayButtonFlatStyle | Gets or sets the flat style of the calendar's Today button. |
TodayButtonForeColor | Gets or sets the text colour of the calendar's Today button. |
TodayButtonText | Gets or sets the caption of the calendar's button that picks today's date. |
TodayCloseButtonsAreVisible | Gets or sets whether the drop-down calendar has its Today and Close buttons. |
TodayEllipseColor | Gets or sets the colour of the circle that marks today's date in the calendar. |
TodayForeColor | Gets or sets the colour of today's date number in the calendar. |
UseDropDownImageStyle | Gets or sets what the editor's drop-down button shows: an arrow, a calendar picture, or
CustomDropDownImage. |
| Methods | |
Clone | Creates a copy of the column with all its settings except
CalendarInactiveDateForeColor, which keeps its default. |
Constructors
BinaryTreeListViewDatePickerColumn
Creates a date column whose cells are BinaryTreeListViewDatePickerCell objects.
Properties
BinaryCultureInfo
Gets or sets the culture the column's dates are written in and its calendar is shown in – month and day names, and the first day of the week.
- Value
- The current culture of the thread that created the column, by default.
Remarks
Applies to every row as it is shown, and to the editor. A cell style with a
Format of its own is formatted by the grid instead.
Example
dueColumn.BinaryCultureInfo = new CultureInfo("fr-FR"); // "vendredi 6 novembre 2026"BorderColor
Gets or sets the colour of the border round the date.
- Value
SystemColors.ControlDarkDarkby default.
Remarks
Used for the editor's border, and for the hairline box of cells that are not being edited when
ShowBorderAlways is on. Copied to the cell's editor when editing starts, as BinaryDatePicker.BorderColor.
CalendarForeColor
Gets or sets the colour of the calendar's dates and day names.
- Value
SystemColors.ControlTextby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CalendarForeColor.
CalendarInactiveDateForeColor
Gets or sets a colour for the days of the previous and next months shown in the calendar.
- Value
SystemColors.ControlDarkby default.
Remarks
The column does not pass this colour to the cell's editor, so setting it does not change the calendar.
CalendarLegendDisplay
Gets or sets whether the calendar shows a legend at its foot explaining the selected-date and today markers.
- Value
trueby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CalendarLegendDisplay.
CalendarMonthAndYearTrackerColor
Gets or sets the colour of the arrows either side of the calendar's month and year title, which move to the previous and next month.
- Value
- Maroon, RGB 128, 0, 0, by default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CalendarMonthAndYearTrackerColor.
CalendarMonthBackColor
Gets or sets the background colour of the calendar.
- Value
SystemColors.Windowby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CalendarMonthBackColor.
CalendarMonthTitleForeColor
Gets or sets the colour of the calendar's month and year title.
- Value
- Maroon, RGB 128, 0, 0, by default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CalendarMonthTitleForeColor.
CloseButtonBackColor
Gets or sets the background colour of the calendar's Close button.
- Value
DefaultBackColorby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CloseButtonBackColor.
CloseButtonFlatStyle
Gets or sets the flat style of the calendar's Close button.
- Value
Standardby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CloseButtonFlatStyle.
CloseButtonForeColor
Gets or sets the text colour of the calendar's Close button.
- Value
DefaultForeColorby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.CloseButtonForeColor.
CloseButtonText
Gets or sets the caption of the calendar's button that closes it.
- Value
- "Close" by default.
Remarks
Set it to translate the button. The button is a fixed 47 by 20 logical pixels, so keep the caption
short. Copied to the cell's editor when editing starts, as BinaryDatePicker.CloseButtonText.
CustomDropDownImage
Gets or sets a picture of your own for the editor's drop-down button.
- Value
null, the default, for the built-in picture.
Remarks
Shown when UseDropDownImageStyle is DropDownImageStyle.CustomImage. It is
not used by cells that are not being edited. Copied to the cell's editor when editing starts, as BinaryDatePicker.CustomDropDownImage.
CustomFormat
Gets or sets the date pattern the column uses when Format is
BinaryDatePickerFormat.Custom.
- Value
- A .NET date and time format string, such as "dd MMM yyyy" or "MMMM d, yyyy 'at' HH:mm"; an empty string by default, which shows the short date pattern.
Remarks
Setting Format to BinaryDatePickerFormat.Long or
BinaryDatePickerFormat.Short replaces this with "D" or "d", so set
Format first. A pattern that cannot format a date leaves the grid's own formatting in
place.
Example
dueColumn.Format = BinaryDatePickerFormat.Custom;
dueColumn.CustomFormat = "ddd d MMM"; // "Fri 6 Nov"DotBorderDepth
Gets or sets the length of each dash of the editor's dotted border.
- Value
- 4 by default.
Remarks
Used while DrawBorderAs is BorderState.Dotted. Copied to the cell's editor when editing starts, as BinaryDatePicker.DotBorderDepth.
DotBorderGap
Gets or sets the gap between the dashes of the editor's dotted border.
- Value
- 5 by default.
Remarks
Used while DrawBorderAs is BorderState.Dotted. Copied to the cell's editor when editing starts, as BinaryDatePicker.DotBorderGap.
DrawBorderAs
Gets or sets whether the editor's border is a continuous line or dotted.
- Value
BorderState.Normal, a continuous line, by default.
Remarks
Applies while EditControlStyleIsExtended is on. Copied to the cell's editor when editing starts, as BinaryDatePicker.DrawBorderAs.
DrawStyleIsFlat
Gets or sets whether cells that are not being edited draw their drop-down button flat – a chevron,
inside a hairline box when ShowBorderAlways is on – or as the classic themed push
button.
- Value
trueby default, matching the other special columns.- Default
true
Remarks
Applies while the grid's
BinaryTreeListView.SpecialColumnCellsToDisplayEditingControlOnCellsAlways is on, which
is when cells show their editor's chrome at all.
EditControlStyleIsExtended
Gets or sets whether the editor's date box has the extended border: one that appears on hover and
focus, can be dotted, and takes BorderColor.
- Value
trueby default.
Remarks
DrawBorderAs, ShowBorderAlways, DotBorderDepth and
DotBorderGap apply only while it is on. Copied to the cell's editor when editing starts, as BinaryDatePicker.EditControlStyleIsExtended.
Format
Gets or sets how the column shows its dates: the culture's long or short date pattern, or
CustomFormat.
- Value
BinaryDatePickerFormat.Longby default.
Remarks
Applies to every row, in the column's BinaryCultureInfo, and to the editor.
Setting BinaryDatePickerFormat.Long or BinaryDatePickerFormat.Short
replaces CustomFormat with "D" or "d". For a custom pattern, set this to
BinaryDatePickerFormat.Custom first and CustomFormat after it.
MarkSelectedDate
Gets or sets whether the calendar marks the selected date and today's date with a filled circle.
- Value
trueby default.
Remarks
The circles are in SelectionDateEllipseColor and TodayEllipseColor. Copied to the cell's editor when editing starts, as BinaryDatePicker.MarkSelectedDate.
SelectionDateEllipseColor
Gets or sets the colour of the circle that marks the selected date in the calendar.
- Value
Color.Blueby default.
Remarks
Drawn while MarkSelectedDate is on. Copied to the cell's editor when editing starts, as BinaryDatePicker.SelectionDateEllipseColor.
See also
SelectionDateForeColor
Gets or sets the colour of the selected date's number in the calendar.
- Value
Color.Yellowby default, to read on the default blue circle.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.SelectionDateForeColor.
See also
ShowBorderAlways
Gets or sets whether a border is drawn round the date at all times, rather than only while the pointer is over the editor or it has the focus.
- Value
falseby default.
Remarks
It also gives cells that are not being edited a hairline box in BorderColor, when they
show the flat chrome (DrawStyleIsFlat). Copied to the cell's editor when editing starts, as BinaryDatePicker.ShowBorderAlways.
TodayButtonBackColor
Gets or sets the background colour of the calendar's Today button.
- Value
DefaultBackColorby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayButtonBackColor.
TodayButtonFlatStyle
Gets or sets the flat style of the calendar's Today button.
- Value
Standardby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayButtonFlatStyle.
TodayButtonForeColor
Gets or sets the text colour of the calendar's Today button.
- Value
DefaultForeColorby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayButtonForeColor.
TodayButtonText
Gets or sets the caption of the calendar's button that picks today's date.
- Value
- "Today" by default.
Remarks
Set it to translate the button. The button is a fixed 47 by 20 logical pixels, so keep the caption
short. Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayButtonText.
TodayCloseButtonsAreVisible
Gets or sets whether the drop-down calendar has its Today and Close buttons.
- Value
trueby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayCloseButtonsAreVisible.
TodayEllipseColor
Gets or sets the colour of the circle that marks today's date in the calendar.
- Value
Color.Greenby default.
Remarks
Drawn while MarkSelectedDate is on. Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayEllipseColor.
See also
TodayForeColor
Gets or sets the colour of today's date number in the calendar.
- Value
Color.Yellowby default, to read on the default green circle.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.TodayForeColor.
See also
UseDropDownImageStyle
Gets or sets what the editor's drop-down button shows: an arrow, a calendar picture, or
CustomDropDownImage.
- Value
DropDownImageStyle.DropDownArrowby default.
Remarks
Copied to the cell's editor when editing starts, as BinaryDatePicker.UseDropDownImageStyle.
Methods
Clone
Creates a copy of the column with all its settings except
CalendarInactiveDateForeColor, which keeps its default.