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

Set Date to null

2 Answers 123 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 01 Jul 2009, 01:36 PM
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 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 05 Jul 2009, 05:50 AM
Any ideas on this?
0
Kaloyan
Telerik team
answered on 06 Jul 2009, 10:48 AM
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.
Tags
DatePicker
Asked by
Dan
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or