Setting both DisplayMode and DateSelectionMode in RadDatePicker

4 posts, 0 answers
  1. Vittorio
    Vittorio avatar
    2 posts
    Member since:
    Apr 2011

    Posted 18 Apr 2011 Link to this post

    Hello everybody,
    I'd like a RadDatePicker to have the following behavior: when the dropdown calendar box opens, the calendar should be in the DecadeView. The user by clicking should arrive to the MonthView where the date is selected.

    I was trying to achieve this by setting both DisplayMode = DecateView and DateSelectionMode = Month but it is not working: setting DateSelectionMode to Month causes the MonthView to be shown when the drop down calendar box is opened (the DisplayMode = DecateView seems to be ignored). Setting the DisplayMode = DecateView only, correctly sets the default view but of course the date is selected when the calendar is in DayView which is not what I really wanted.

    What can I do to achieve the behaviour explained above?
    Thanks you in advance.
  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 21 Apr 2011 Link to this post

    Hi Vittorio,

    In order to select days DateSelectionMode should be Day. You have to use a Style in order to apply the DisplayMode to the Calendar of the DatePicker. Here is the sample code:
    <telerik:RadDatePicker  DateSelectionMode="Day">
        <telerik:RadDatePicker.CalendarStyle>
            <Style TargetType="telerik:RadCalendar">
                <Setter Property="DisplayMode" Value="CenturyView" />
            </Style>
        </telerik:RadDatePicker.CalendarStyle>
    </telerik:RadDatePicker>

    I think this will suit your needs.

    Regards,
    Boyan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Vittorio
    Vittorio avatar
    2 posts
    Member since:
    Apr 2011

    Posted 21 Apr 2011 Link to this post

    I'm sorry, my problem was not clearly explained...
    I would like the date to be selected when the user clicks on the Month (so DateSelectionMode = Month) but I also would like the radcalendar to open in DecadeView by default (so DisplayMode = DecadeView setted in style as you suggested).

    My problem is that setting DateSelectionMode to Month seems to cause DisplayMode = DecadeView to be ignored as the calendar opens in MonthView and not in DecadeView...

    Is there a way to have DecadeView as the default DisplayMode and the date to be selected when the month is clicked by the user?
  5. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 26 Apr 2011 Link to this post

    Hi Vittorio,

    Thank you for the clarification, I have misunderstood you. Now I was able to reproduce the problem. This is a bug at our side. I have created a PITS item where you can follow the progress.

    Sorry for the inconvenience caused, I have updated your Telerik points for the report.

    Greetings,
    Boyan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top