C1DateTimePicker Control Help > C1DateTimePicker Task-Based Help > Allowing Null Values |
By default, the C1DateTimePicker control doesn't allow users to enter null values, but you can force the control to accept a null value by setting the C1DateTimePicker.AllowNull property to True. In this topic, you will learn how to set the AllowNull property to True in the designer, in XAML, and in code.
In the Designer
Complete the following steps:
In XAML
To allow null values, place AllowNull="True" to the <my:C1DateTimePicker> tag so that the markup resembles the following:
<my:C1DateTimePicker AllowNull="True"/>
In Code
Complete the following steps:
Visual Basic |
Copy Code
|
---|---|
C1DateTimePicker1.AllowNull = True
|
C# |
Copy Code
|
---|---|
c1DateTimePicker1.AllowNull = true;
|
Tip: to set null value at run-time, users should either clear all the text in the DatePicker portion of the control and press ENTER or move focus to the TimeEditor portion of the control. |