Set Date to null

3 posts, 0 answers
  1. Dan
    Dan avatar
    8 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    I'd like to modify the template of the DatePicker but I'm not sure exactly the best way to go about it.  I know that currently if the user clicks on the already selected date then it sets the SelectedDate to null, but what I'd like is a button on the outside of the DatePicker that can be clicked to set the date to null.

    So the control would look like

    <Textbox with date><Button to bring up calendar><Button to set value to null>

    The button would only be clickable when there is a date of course.

    I'm considering just putting together a UserControl that has this functionality, but I was wondering if there's an easy way to do it using a DataTemplate.
  2. James
    James avatar
    41 posts
    Member since:
    Jul 2007

    Posted 05 Jul 2009 Link to this post

    Any ideas on this?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 06 Jul 2009 Link to this post

    Hello James,

    Thank you for contacting us.

    It is possible to redefine the DatePicker's template and add some additional button for your case, but you will have to write a lot of XAML code in order to achieve the same UI of the control. We have a post on how you can do this using Expression Blend. Another problem is that you have to add custom logic for handling the button click event, of which RadDatePicker will not be aware. I think that your suggestion (Creating a separate UserControl which consist of a RadDatePicker and a button) is the easiest way to accomplish your task.

    Regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top