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

Set DateSelection mode to year but I still want to select a day

3 Answers 43 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Brock
Top achievements
Rank 1
Brock asked on 10 Oct 2011, 07:46 AM
Hey,

For a date of birth field it would be really nice to have the first "selection" screen to go to the year view but still be able to drill down from there to an actual "day".  At the moment I have to "drill up" to the years and then go all the way down again. 

If I change the DateSelectionMode to "year" it does what I want in terms of the initial selection screen, but then I cant drill down to a day.

Is there a way to do what I want?

Thanks

Brock

3 Answers, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 10 Oct 2011, 09:14 AM
Hello Brock,

You can achieve what you want by setting DisplayMode=YearView in the RadCalendar style. Here is a sample code:
<telerik:RadDatePicker>
    <telerik:RadDatePicker.CalendarStyle>
        <Style TargetType="telerik:RadCalendar" >
            <Setter Property="DisplayMode" Value="YearView" />
        </Style>
    </telerik:RadDatePicker.CalendarStyle>
</telerik:RadDatePicker>
This should work for your scenario.


Greetings,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
ClausDC
Top achievements
Rank 1
answered on 20 Jan 2012, 10:56 AM
Any chance to extend this in such a way that DisplayMode resets to a specific view everytime the user opens the calendar view?

As it is now, with the style from Boyan applied, it works one time but subsequent opening of the calendar view remembers the last selected DisplayMode.
0
Boyan
Telerik team
answered on 25 Jan 2012, 12:54 PM
Hi Brock,

Unfortunately this is a Calendar property and it is working this way. The YearView DisplayMode is set just  initially and then it is left to the View that the user as navigated to. I tried to workaround the problem by resetting the CalendarStyle on DropDownOpened event but with no success.

All the best,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DatePicker
Asked by
Brock
Top achievements
Rank 1
Answers by
Boyan
Telerik team
ClausDC
Top achievements
Rank 1
Share this question
or