4 Answers, 1 is accepted
0
Hello rob mays,
RadDateTimePicker has NullDate support. When you set its Value to its NullDate (NullDate by default is equal to the MinDate), the text you will see in RadDateTimePicker would be set to the NullText. NullText by default is an empty string.
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
RadDateTimePicker has NullDate support. When you set its Value to its NullDate (NullDate by default is equal to the MinDate), the text you will see in RadDateTimePicker would be set to the NullText. NullText by default is an empty string.
- In order to set the NullDate to a different date than the MinDate, you should set the NullDate of the DateTimePickerElement:
this.radDateTimePicker1.DateTimePickerElement.NullDate = DateTime.Now; - In order to set the value to NullDate, call the SetToNullValue method:
this.radDateTimePicker1.DateTimePickerElement.SetToNullValue();
If you have additional questions, feel free to contact me.
Regards,
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
rob mays
Top achievements
Rank 1
answered on 03 Jul 2008, 07:17 AM
many thanks for the response sorted it out for me. Well Done
0
Ed Molieri
Top achievements
Rank 1
answered on 11 Oct 2011, 07:36 PM
Hello, I'm having the following issue:
When I trap the delete key on KeyDown I set DateTimePickerElement.SetToNullValue(); As expected the control's value disappears and the text box becomes blank. The issue is that as soon as the control loses focus the old value re-displays.
Please help.
When I trap the delete key on KeyDown I set DateTimePickerElement.SetToNullValue(); As expected the control's value disappears and the text box becomes blank. The issue is that as soon as the control loses focus the old value re-displays.
Please help.
0
Hi Eduardo Molieri,
I suppose that you are using Q3 2010 version.
In this case you should simply call SetToNullValue method and handle the event.
Please refer to the attached project.
I hope this helps.
Best wishes,
Peter
the Telerik team
I suppose that you are using Q3 2010 version.
In this case you should simply call SetToNullValue method and handle the event.
void
radDateTimePicker1_KeyPress(
object
sender, KeyPressEventArgs e)
{
if
(e.KeyChar ==
'd'
)
{
this
.radDateTimePicker1.DateTimePickerElement.SetToNullValue();
e.Handled =
true
;
}
}Please refer to the attached project.
I hope this helps.
Best wishes,
Peter
the Telerik team
Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.