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

Need to control how the user enters the date

1 Answer 27 Views
DatePicker for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Philip
Top achievements
Rank 2
Philip asked on 18 May 2014, 05:25 PM
I'm writing an app where the user may have any of the following permutations of a date:

Year
Year and month
Year, month and day in month

I'd therefore like to either start off just displaying the year and then only add month once the user has set the year value, and the day once the user has set the month value or, perhaps better, display all three columns but have values of "not set" for day and month so that I can tell when the user has specified the value, e.g. the Month column should have 13 values - 1 to 12 and "Select", with the latter being the initial value.

Is this at all possible? If not, any other suggestions on how I might approach this?

Thanks.

Philip

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 22 May 2014, 08:32 AM
Hi Philip,

Thank you for the question and sorry for the late reply.

Unfortunately, this scenario can not be accomplished with the current version of the RadDatePicker control. All available values in the picker lists are a part of a valid DateTime structure and this is why they can not have unset value. There is a RadDatePicker.SelectorFormat property that defines what date parts are available for selection, but in the current version there is no logic that handles the change of this property. A possible solution is to use 3 pickers and display only one at a time by toggling their visibility depending on what values you wish to select. I have attached a sample project that is the closest we can get to what you want. The only problem is the unpleasant blink when switching the visibility of the pickers.

I hope this helps. Please, let us know if you have any other questions.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DatePicker for XAML
Asked by
Philip
Top achievements
Rank 2
Answers by
Rosy Topchiyska
Telerik team
Share this question
or