This is a migrated thread and some comments may be shown as answers.

Checkbox or Nullable dates on RadDateTimePicker

3 Answers 373 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Phi
Top achievements
Rank 1
Phi asked on 20 Sep 2007, 06:22 AM
Hello,

How do I let the user enter in a null or empty date using the RadDateTimePicker? Shouldn't there be a checkbox, which the user can uncheck if they want to specify an empty date?

There is a "Checked" property on the RadDateTimePicker, but it doesn't appear to do much, and all the documentation says is: "When ShowCheckBox is true, determines that the user has selected a value"

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Dimitar Kapitanov
Telerik team
answered on 21 Sep 2007, 02:18 PM
Hi Phi,
At the moment the DateTimePicker control is at stable state, but it is not officially recognized as a part of our RadControls suite. This is because it is scheduled for official release for Q3 2007 and we came with a stable version earlier than expected. Null value and the Checked functionality were part of the features that were not implemented for Q2. Also the text box is in a disabled state (we have to implement masked edit before we release a fully featured date-time picker). We believe we will be ready for Q3 Beta (no particular time-frame at the moment) with a fully-featured control to be tested. If you have any particular questions about this control do not hesitate to write us back.

All the best,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin Meyer
Top achievements
Rank 1
answered on 05 Feb 2008, 08:12 PM
Can you provide a sample for clearing a RadDateTimePicker with Q3 07?  Do we still have to register to the ToggleStateChanged event of the wrapped check box and handle it manually?

Ultimately, I'm wanting to bind to a nullable DateTime and have the checked state map to null.
0
Boyko Markov
Telerik team
answered on 08 Feb 2008, 03:12 PM
Hi Kevin Meyer,

If you've used this approach before I suggest to continue using it.

We have a glitch with the null date property in the Q3 release after we've added the RadMaskedEditBox to the RadDateTimePicker. However, by design we use the SetToNullValue method to set the null value. You can explicitly set the value property using the Value property of RadDateTimePicker.

You can also use the NullText property of RadDateTimePickerElement. In order to explicitly access the RadMaskedEditBox you can use the TextBoxElement property of RadDateTimePickerElement. The following code is demonstrates how to do it:

RadMaskTextBox maskBox = (textBoxElement.TextBoxItem.HostedControl as RadMaskTextBox);

The masked box is actually the box where you edit the dates in the RadDateTimePicker. Its Value property is synchronized with the Value property of RadDateTimePicker and you are able to set its value by setting the Value property of RadDateTimePicker or set the MaskEditValue of the mask box.

I hope this explanations will help you to better understand the structure of RadDateTimePicker.

If you have any other questions, please feel free to write me back.

Greetings,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Phi
Top achievements
Rank 1
Answers by
Dimitar Kapitanov
Telerik team
Kevin Meyer
Top achievements
Rank 1
Boyko Markov
Telerik team
Share this question
or