Checkbox or Nullable dates on RadDateTimePicker

4 posts, 0 answers
  1. Phi
    Phi avatar
    19 posts
    Member since:
    Jun 2007

    Posted 20 Sep 2007 Link to this post

    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?
  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 21 Sep 2007 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kevin Meyer
    Kevin Meyer avatar
    36 posts
    Member since:
    Dec 2007

    Posted 05 Feb 2008 Link to this post

    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.
  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 08 Feb 2008 Link to this post

    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
Back to Top