# Properties

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);
```

```VB.NET
Me.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);
```

```VB.NET
Me.RadDateOnlyPicker1.MinDate = New DateOnly(2024,10,1)
Me.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;
```

```VB.NET
Me.RadDateOnlyPicker1.NullableValue = Nothing
```

**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));
}
```

```VB.NET
Public Class MyObject
    Public Sub New(ByVal _endTime? As DateOnly)
        Me._endTime = _endTime
    End Sub
    Private _endTime? As DateOnly
    Public Property EndTime() As DateOnly?
        Get
            Return _endTime
        End Get
        Set(ByVal value? As DateOnly)
            _endTime = value
        End Set
    End Property
End Class

Protected Overrides Sub OnLoad(ByVal e As EventArgs)
    MyBase.OnLoad(e)
    Dim myObject As MyObject = New MyObject(DateOnly.FromDateTime(DateTime.Now.AddDays(1)))
    Me.radDateOnlyPicker1.DataBindings.Add(New Binding("NullableValue", myObject, "EndTime", True, DataSourceUpdateMode.OnPropertyChanged))
End Sub
```

* **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";
```

```VB.NET
Me.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](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/features/internationalization) and [Date Formats](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/features/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](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/features/internationalization) and [Date Formats](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/features/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

| Event                    | Description                                                                                                                                                                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **MaskProviderCreated**  | Occurs 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. |
| **ValueChanged**         | Occurs when the value of the control has changed.                                                                                                                                                |
| **NullableValueChanged** | Occurs when the value of the control has changed.                                                                                                                                                |
| **FormatChanged**        | Occurs when the format of the control has changed.                                                                                                                                               |
| **ValueChanging**        | Occurs when the value of the control is changing.                                                                                                                                                |
| **Opened**               | Occurs when the drop down is opened.                                                                                                                                                             |
| **Opening**              | Occurs when the drop down is opening.                                                                                                                                                            |
| **Closing**              | Occurs when the drop down is closing.                                                                                                                                                            |
| **Closed**               | Occurs when the drop down is closed.                                                                                                                                                             |
| **ToggleStateChanging**  | Occurs before the CheckBox's state changes.                                                                                                                                                      |
| **ToggleStateChanged**   | Occurs when the CheckBox's state changes.                                                                                                                                                        |
| **CheckedChanged**       | Occurs when the value of the checkbox in the editor is changed                                                                                                                                   |

## See Also

* [Design Time](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/design-time)
* [MaskDateTimeProvider](https://www.telerik.com/products/winforms/documentation/controls/editors/datetimepicker/maskdatetimeprovider)
* [Structure](https://www.telerik.com/products/winforms/documentation/controls/editors/dateonlypicker/structure)
