New to Telerik UI for WinFormsStart a free 30-day trial

Properties

Updated over 6 months ago

The significant properties for RadDateOnlyPicker are:

  • Value: This is the date selected from the picker and can be set in code or from the drop down calendar in the Properties window.

Setting the value of RadDateOnlyPicker

C#
this.radDateOnlyPicker1.Value = new DateOnly(2024,1,1);
  • MinDate, MaxDate: These two DateOnly type properties form the bounds that dates can be selected from in the picker. Attempts to select outside these bounds are ignored.

Setting the MinDate property of RadDateOnlyPicker

C#
this.radDateOnlyPicker1.MinDate = new DateOnly(2024,10,1);
this.radDateOnlyPicker1.MaxDate = new DateOnly(2024,10,31);
  • NullableValue is same as the Value property, but the NullableValue property is of type Nullable DateOnly. It can be null – in this case if RadDateOnlyPicker is not selected, it will show its NullText. In case RadDateOnlyPicker is selected, it will show the last entered date – this allows the end-user to enter and edit the date.

Setting the NullableValue property of RadDateOnlyPicker

C#
this.radDateOnlyPicker1.NullableValue = null;

NullableValue can be bound to a business object that exposes a property of type nullable DateOnly. The code below demonstrates how to do this:

Bind the NullableValue to a business object.

C#
public class MyObject
{
    public MyObject(DateOnly? _endTime)
    {
        this._endTime = _endTime;
    }
    private DateOnly? _endTime;
    public DateOnly? EndTime
    {
        get { return _endTime; }
        set { _endTime = value; }
    }
}

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    MyObject myObject = new MyObject(DateOnly.FromDateTime(DateTime.Now.AddDays(1)));
    this.radDateOnlyPicker1.DataBindings.Add(new Binding("NullableValue", myObject, "EndTime", true, DataSourceUpdateMode.OnPropertyChanged));
}
  • NullText: This property defines the text that will be displayed in RadDateOnlyPicker when the NullableValue property is set to null and RadDateOnlyPicker is not in focus. By default, NullText is an empty string.

Setting the NullText property of RadDateOnlyPicker

C#
this.radDateOnlyPicker1.NullText = "No date selected";
  • TextBoxElement: Gets an instance of RadTextBoxElement.

  • ArrowButton: Gets an instance of RadArrowButtonElement.

  • CheckBox: Gets an instance of RadCheckBoxElement.

  • CurrentBehavior: Gets an instance of RadDateOnlyPickerCalendar.

  • AutoSelectNextPart: This property controls whether or not the next date part will be automatically selected when the user types.

  • ReadOnly: Gets or sets a value indicating whether RadDateOnlyPicker is read-only.

  • ShowUpDown: Indicates whether a spin box rather than a drop down calendar is displayed for editing the control's value.

  • Culture: Determines the language that the drop down calendar and text box will display.  See the Internationalization and Date Formats topic for more information.

  • NullDate: The DateOnly value assigned to the date picker when the Value is null.

  • IsDropDownShown: Gets if the dropdown is shown.

  • Checked: When ShowCheckBox is true, determines that the user has selected a value.

  • CustomFormat: A format string that determines the display of the date in the picker edit. See the Internationalization and Date Formats topic for more information.

  • Format: The DateOnlyPickerFormat enumeration values are Long, Short, Time and Custom. Set Format to Custom to enable the CustomFormat property.

The Time option of the DateTimePickerFormat enumeration is not applicable for the RadDateOnlyPicker control. The Time option will be ignored when set to the RadDateOnlyPicker control Format property.

  • ThemeName: Sets the overall look of the control. Choose from a list of predefined themes or create your own using the Visual Style Builder available from the RadDateOnlyPicker's Smart Tag.

  • CalendarSize: Gets or sets the size of the RadCalendar in the RadDateOnlyPicker drop-down.

  • CalendarLocation: Gets or sets the location of the drop down showing the calendar.

  • Calendar: Get nested RadCalendar in the popup part of the RadDateOnlyPicker.

Events

EventDescription
MaskProviderCreatedOccurs when MaskProvider has been created This event will be fired multiple times because the provider is created when some properties changed Properties are: Mask, Culture, MaskType and more.
ValueChangedOccurs when the value of the control has changed.
NullableValueChangedOccurs when the value of the control has changed.
FormatChangedOccurs when the format of the control has changed.
ValueChangingOccurs when the value of the control is changing.
OpenedOccurs when the drop down is opened.
OpeningOccurs when the drop down is opening.
ClosingOccurs when the drop down is closing.
ClosedOccurs when the drop down is closed.
ToggleStateChangingOccurs before the CheckBox's state changes.
ToggleStateChangedOccurs when the CheckBox's state changes.
CheckedChangedOccurs when the value of the checkbox in the editor is changed

See Also

In this article
EventsSee Also
Not finding the help you need?
Contact Support