Class DateTimePickerAdv
The DateTimePickerAdv control extends the Windows Forms DateTimePicker control and provides several important features.
Internationalization - The DateTimePickerAdv control is fully culture aware.
Databinding - Supports DataBinding with a data source. Supports null value.
Custom dropdown - The DateTimePickerAdv can display a custom drop down calendar.
XP Themes - The DateTimePickerAdv control supports XP themes when applicable.
Inheritance
System.Object
DateTimePickerAdv
Implements
System.ComponentModel.ISupportInitialize
Assembly: Syncfusion.Tools.Windows.dll
public class DateTimePickerAdv : GradientPanel, IThemeProvider, INonClientPaintingSupport, ISupportInitialize, IThemedControl, IVisualStyle, ISupportCulture
Constructors
Declaration
public DateTimePickerAdv()
Properties
Gets or sets a value indicating whether after the completion of a field the DateTimePicker advances to the next field.
Declaration
public bool AutoForwarding { get; set; }
Property Value
Gets are sets the Back color of the control. (overridden property)
Declaration
public override Color BackColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the wrapper property around the selected date of the picker. Use this property if you
want to be able to set the value of the control to null.
Declaration
public object BindableValue { get; set; }
Property Value
Overrides Border Color property
Declaration
public override Color BorderColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Overrides
Declaration
public DateTimePickerAdv.MonthCalendarForDateTimePickerAdv Calendar { get; }
Property Value
Gets or sets the font of the popup calendar.
Declaration
public Font CalendarFont { get; set; }
Property Value
Gets or sets the forecolor of the popup calendar.
Declaration
public Color CalendarForeColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the backcolor of the popup calendar.
Declaration
public Color CalendarMonthBackground { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the size of the popup Calendar.
Declaration
public Size CalendarSize { get; set; }
Property Value
Gets or sets a value indicating whether the calendar will size according to the widths of the days.
Declaration
public bool CalendarSizeToFit { get; set; }
Property Value
Gets or sets the title backcolor of the popup calendar.
Declaration
public Color CalendarTitleBackColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the title forecolor of the popup calendar.
Declaration
public Color CalendarTitleForeColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the trailing forecolor of the popup calendar.
Declaration
public Color CalendarTrailingForeColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets a value indicating whether the checked state of the checkbox is set.
Declaration
public bool Checked { get; set; }
Property Value
Gets or sets the format of the value of the picker when copying.
Declaration
public DateTimePickerFormat ClipboardFormat { get; set; }
Property Value
Type |
System.Windows.Forms.DateTimePickerFormat |
Gets or sets a value indicating whether when copy or paste operation is done, only the selected field is taken into consideration.
Declaration
public bool CopyFieldsOnly { get; set; }
Property Value
Gets or sets the current culture of the picker.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type |
System.Globalization.CultureInfo |
Gets currently used calendar.
Declaration
public Calendar CurrentCalendar { get; }
Property Value
Type |
System.Globalization.Calendar |
Gets or sets a value indicating whether the CustomPopupWindow will be shown instead of the internal calendar popup.
Declaration
public bool CustomDrop { get; set; }
Property Value
Gets or sets the format of the picker when Format is Custom.
Declaration
public string CustomFormat { get; set; }
Property Value
Gets or sets the PopupControlContainer that will be shown instead of the internal calendar.
If the container contains controls implementing the IDateTimePickerAdvCalendar interface and the Active property set to true the
picker will interact with those controls like the internal calendar.
Declaration
public PopupControlContainer CustomPopupWindow { get; set; }
Property Value
Gets or sets the year that will complete the year fields when typing.
Declaration
public int DigitYear { get; set; }
Property Value
Gets or sets the popup window`s alignment.
Declaration
public LeftRightAlignment DropDownAlign { get; set; }
Property Value
Type |
System.Windows.Forms.LeftRightAlignment |
Gets or sets the image for DropDown button.
Declaration
public Image DropDownImage { get; set; }
Property Value
Type |
System.Drawing.Image |
Gets or sets the drop down backcolor in normal mode.
If color is empty then uses the default color.
Declaration
public Color DropDownNormalColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the drop down backcolor in pressed mode.
If color is empty then uses the default color.
Declaration
public Color DropDownPressedColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the drop down backcolor in selected mode.
If color is empty then uses the default color.
Declaration
public Color DropDownSelectedColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets a value indicating whether the null date support is enabled. If set to false the DateTimePicker will always have a selected date.
Declaration
public bool EnableNullDate { get; set; }
Property Value
Gets or sets a value indicating whether the Backspace or Delete keys make the date null.
Declaration
public bool EnableNullKeys { get; set; }
Property Value
Gets or sets the fields of the DateTimePickerAdv.
Declaration
protected DTField[] FieldsArray { get; set; }
Property Value
Gets or sets a value indicating whether the dropdown button will have a flat appearance.
Declaration
public bool FlatDropButton { get; set; }
Property Value
Declaration
public override Font Font { get; set; }
Property Value
Gets or sets the format of the picker.
Declaration
public DateTimePickerFormat Format { get; set; }
Property Value
Type |
System.Windows.Forms.DateTimePickerFormat |
Gets or sets value indicating what action should be chosen if user try to enter value that is not within the specified min or max range.
Declaration
public InvalidDateProcessing InvalidDateProcessing { get; set; }
Property Value
Gets or sets a value indicating whether there is no date selected.
Declaration
public bool IsNullDate { get; set; }
Property Value
Gets or sets the maximum value that can be picked from the picker.
Declaration
public DateTime MaxValue { get; set; }
Property Value
Gets or sets the theme color of the DateTimePickerAdv
Declaration
public Color MetroColor { get; set; }
Property Value
Type |
System.Drawing.Color |
Gets or sets the minimum value that can be picked from the picker.
Declaration
public DateTime MinValue { get; set; }
Property Value
Gets or sets the image list of the popup menu of the popup calendar.
Declaration
public ImageList MonthImageList { get; set; }
Property Value
Type |
System.Windows.Forms.ImageList |
Gets or sets a value indicating whether the none date button visible.
Declaration
public bool NoneButtonVisible { get; set; }
Property Value
Gets or sets the Nullable date of the Control
Declaration
public DateTime? NullableValue { get; set; }
Property Value
Type |
System.Nullable<System.DateTime> |
Gets or sets the keys which will toggle off null date.
Declaration
public NullModeKeyReset NullModeKeyReset { get; set; }
Property Value
Gets or sets the text to be displayed, when no date is selected.
Declaration
public string NullString { get; set; }
Property Value
Gets or sets the Office2007 theme used for drawing the control.
Declaration
public Office2007Theme Office2007Theme { get; set; }
Property Value
Gets or sets the Office2010 theme used for drawing the control.
Declaration
public Office2010Theme Office2010Theme { get; set; }
Property Value
Gets the Popup window calendar.
Declaration
public CalendarPopup PopupWindow { get; }
Property Value
Gets or sets a value indicating whether toggles the read only state of the picker.
Declaration
public bool ReadOnly { get; set; }
Property Value
Gets or sets a value indicating whether the valueChange when control is readonly.
Declaration
public bool ReadOnlyValueChange { get; set; }
Property Value
Gets or sets a value indicating whether selection should be reset to first field on focus.
Declaration
public bool ResetSelectionOnFocus { get; set; }
Property Value
Type |
Description |
System.Boolean |
true if reset selection on focus; otherwise, false .
|
Gets or sets the selected field of the DateTimePickerAdv.
Declaration
protected DTField SelectedField { get; set; }
Property Value
Gets or sets a value indicating whether the checkBox will be visible.
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Gets or sets a value indicating whether the drop button is visible.
Declaration
public bool ShowDropButton { get; set; }
Property Value
Gets or sets a value indicating whether calendar drop down should be shown when pressing ALT + down arrow key
when NULL date is set.
Declaration
public bool ShowDropDownOnNull { get; set; }
Property Value
Type |
Description |
System.Boolean |
true if show drop down when null date is set; otherwise, false .
|
Gets or sets a value indicating whether the UpDown buttons are visible.
Declaration
public bool ShowUpDown { get; set; }
Property Value
Gets or sets a value indicating whether the UpDown buttons will be visible when it gets the focus.
Declaration
public bool ShowUpDownOnFocus { get; set; }
Property Value
Gets or sets the size of the DateTimePickerAdv control.
Declaration
public Size Size { get; set; }
Property Value
Gets or sets the spacing between the fields of the picker.
Declaration
public int Spacing { get; set; }
Property Value
Gets or sets a value indicating whether the image for scroll button
is stretched or shrunk to fit the size of the scroll button.
Declaration
public bool StretchDropDownImage { get; set; }
Property Value
Gets or sets the Office style of the Date Time Picker.
Declaration
public VisualStyle Style { get; set; }
Property Value
Gets or sets a value to supress the Value of DateTimePicker on ValueChanged event
Declaration
public bool SuppressValueChangedOnNavigation { get; set; }
Property Value
Gets or sets a value indicating whether the DateTimePicker will advance to the next field.
Declaration
public bool TabForwarding { get; set; }
Property Value
Gets or sets a value indicating whether the focus will be moved off the control when there are no fields to tab through.
Declaration
public bool TabLeave { get; set; }
Property Value
Declaration
public bool TabStop { get; set; }
Property Value
Gets or sets a value indicating whether the checkbox, drop button, updown and calendar will be themed.
Declaration
public bool ThemedChildControls { get; set; }
Property Value
Gets or set the value to apply the border syle of the DateTimePickerAdv
Declaration
public bool UseBorderStyle { get; set; }
Property Value
Gets or sets a value indicating whether the current culture of the machine will be used. The culture will be set to the System.Globalization.CultureInfo.CurrentCulture culture.
Declaration
public bool UseCurrentCulture { get; set; }
Property Value
Gets or sets a value indicating whether the context menu will be a Syncfusion XPMenu.
Declaration
public bool UseEnhancedMenu { get; set; }
Property Value
Gets or sets a value indicating whether the shortest name of the weekdays should be used. This property value have influence only under Framework 2.0 and higher.
Declaration
public bool UseShortestDayNames { get; set; }
Property Value
Gets or sets the selected date of the picker.
Declaration
public DateTime Value { get; set; }
Property Value
Gets or sets a value indicating whether the UpDown will have a VS like look.
Declaration
public bool VSLikeUpDown { get; set; }
Property Value
Gets the one-based index of the week of year.
Declaration
public int WeekOfYear { get; }
Property Value
Methods
Declaration
protected static double ArgToRadians(long arg)
Parameters
Type |
Name |
Description |
System.Int64 |
arg |
|
Returns
Copies Value property to clipboard.
Declaration
Returns
Type |
Description |
System.Boolean |
True if value has been sucessfully copied.
|
Cuts Value property to clipboard.
Declaration
Returns
Type |
Description |
System.Boolean |
True if value has been sucessfully cut.
|
Declaration
public void DisplayCalendar()
Cleans up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
Bool disposing
|
Overrides
Declaration
protected DTField Fields(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Declaration
public override Size GetPreferredSize(Size proposedSize)
Parameters
Type |
Name |
Description |
System.Drawing.Size |
proposedSize |
|
Returns
Virtual function used to initialize the default popup window.
Declaration
protected virtual void InitDefaultPopup(CalendarPopup defaultPopup)
Parameters
Declaration
protected override bool IsInputChar(char charCode)
Parameters
Type |
Name |
Description |
System.Char |
charCode |
|
Returns
Override this method when you want to modify the default behavior of the DateTimePickerAdv
that jumps to select the first field when the last is selected and the right arrow is pressed and vice versa.
Declaration
protected virtual bool JumpField()
Returns
Type |
Description |
System.Boolean |
A bool value that indicates whether to jump or not.
|
Specifies whether to show current date in MonthCalenderAdv
Declaration
public void NavigateToCurrentDate(bool m_navigate)
Parameters
Type |
Name |
Description |
System.Boolean |
m_navigate |
Specifies whether to navigate to current date
|
Declaration
protected virtual void OnBeforePopup(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnBindableValueChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
An System.EventArgs that contains the event data.
|
Declaration
protected override void OnBorderColorChanged()
Overrides
Declaration
protected override void OnBorderStyleChanged()
Overrides
Declaration
protected virtual void OnCheckBoxCheckedChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnOffice2007ThemeChanged()
Declaration
protected virtual void OnOffice2010ThemeChanged()
Declaration
protected virtual void OnOnPopup(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.PaintEventArgs |
e |
|
Overrides
Declaration
protected virtual void OnPopupClosed(PopupClosedEventArgs e)
Parameters
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnStretchDropDownImageChanged()
Declaration
protected override void OnThemeChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Declaration
protected virtual void OnValueChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Pastes clipboard data to Value property.
Declaration
Returns
Type |
Description |
System.Boolean |
True if clipboard data has been sucessfully pasted.
|
Declaration
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Message |
msg |
|
System.Windows.Forms.Keys |
keyData |
|
Returns
Refreshes all date-time input fields of the control.
Declaration
public void RefreshFields()
Declaration
protected void ResetBackColor()
Declaration
protected void ResetBorderColor()
Declaration
protected void ResetCalendarFont()
Declaration
protected void ResetCalendarForeColor()
Declaration
protected void ResetCalendarMonthBackground()
Declaration
protected void ResetCalendarSize()
Declaration
protected void ResetCalendarTitleBackColor()
Declaration
protected void ResetCalendarTitleForeColor()
Declaration
protected void ResetCalendarTrailingForeColor()
Declaration
protected void ResetCulture()
Declaration
protected void ResetCustomFormat()
Declaration
protected void ResetDropDownAlign()
Declaration
protected void ResetDropDownNormalColor()
Declaration
protected void ResetDropDownPressedColor()
Declaration
protected void ResetDropDownSelectedColor()
Declaration
public override void ResetForeColor()
Declaration
protected void ResetMaxValue()
Declaration
protected void ResetMinValue()
Declaration
public void ResetNullableValue()
Declaration
protected void ResetStyleBorderColor()
Reset the SuppressValueChangedOnNavigation.
Declaration
protected void ResetSuppressValueChangedOnNavigation()
Declaration
public void ResetUseBorderStyle()
Declaration
protected void ResetValue()
Declaration
protected bool ShouldSerializeBackColor()
Returns
Declaration
protected bool ShouldSerializeBorderColor()
Returns
Declaration
protected bool ShouldSerializeCalendarFont()
Returns
Declaration
protected bool ShouldSerializeCalendarForeColor()
Returns
Declaration
protected bool ShouldSerializeCalendarMonthBackground()
Returns
Declaration
protected bool ShouldSerializeCalendarSize()
Returns
Declaration
protected bool ShouldSerializeCalendarTitleBackColor()
Returns
Declaration
protected bool ShouldSerializeCalendarTitleForeColor()
Returns
Declaration
protected bool ShouldSerializeCalendarTrailingForeColor()
Returns
Declaration
protected bool ShouldSerializeCulture()
Returns
Declaration
protected bool ShouldSerializeCustomFormat()
Returns
Declaration
protected bool ShouldSerializeDropDownAlign()
Returns
Declaration
protected bool ShouldSerializeDropDownNormalColor()
Returns
Declaration
protected bool ShouldSerializeDropDownPressedColor()
Returns
Declaration
protected bool ShouldSerializeDropDownSelectedColor()
Returns
Declaration
protected bool ShouldSerializeMaxValue()
Returns
Declaration
protected bool ShouldSerializeMinValue()
Returns
Declaration
public bool ShouldSerializeNullableValue()
Returns
Declaration
protected bool ShouldSerializeSize()
Returns
Declaration
protected bool ShouldSerializeStyleBorderColor()
Returns
Serialize the SuppressValueChangedOnNavigation.
Declaration
protected bool ShouldSerializeSuppressValueChangedOnNavigation()
Returns
Indicates whether the current value of the UseBorderStyle property is to be serialized.
Declaration
protected bool ShouldSerializeUseBorderStyle()
Returns
Declaration
protected bool ShouldSerializeValue()
Returns
Declaration
protected override void WndProc(ref Message m)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Message |
m |
|
Overrides
Events
Declaration
public event EventHandler BeforePopup
Event Type
Declaration
public event EventHandler BindableValueChanged
Event Type
Occurs when check-box's checked state is changed.
Declaration
public event EventHandler CheckBoxCheckedChanged
Event Type
Declaration
public event KeyPressEventHandler KeyPress
Event Type
Type |
System.Windows.Forms.KeyPressEventHandler |
Declaration
public event EventHandler OnPopup
Event Type
Declaration
public event PopupClosedEventHandler PopupClosed
Event Type
Declaration
public event EventHandler StretchDropDownImageChanged
Event Type
Occurs when Value property is changed.
Declaration
public event EventHandler ValueChanged
Event Type
Explicit Interface Implementations
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Implements
System.ComponentModel.ISupportInitialize