Interacting between RadCalendar and RadScheduler

5 posts, 1 answers
  1. Brian King
    Brian King avatar
    23 posts
    Member since:
    Jul 2009

    Posted 22 Oct 2010 Link to this post

    Hi, I've been creating a page that utilizes 2 Rad controls. A Rad calendar set up in a multi-month view (CalendarSlider) and a Rad Scheduler (TheScheduler). I've been trying to create an interaction where when clicking on a day in the CalendarSlider will cause TheScheduler to change from a MonthlyView (as it is initialized that way) to a DayView.

    So far I have been able to capture the CalendarSlider_SelectionChanged event and retrieve the date the user wishes to navigate to. The problem I'm coming across is when I set the values for TheScheduler to change to a DayView and to navigate to the selected date it does not work.

    Normally this isn't something that would be desired as it would be much simpler to pull down the calendar that is already built into the scheduler and change the page, but unfortunately these are my requirements.

    Here's what my method is looking like currently:

    void CalendarSlider_SelectionChanged(object sender, SelectedDatesEventArgs e)
        RadDate selectedDay = e.SelectedDates[0];
        TheScheduler.SelectedDate = selectedDay.Date;
        TheScheduler.SelectedView = SchedulerViewType.DayView;
        RadCalendar radPopupCal = TheScheduler.FindControl("SelectedDateCalendar") as RadCalendar;
        radPopupCal.SelectedDate = selectedDay.Date;
        radPopupCal.ShowOtherMonthsDays = true;
        radPopupCal.FocusedDate = selectedDay.Date;

    Once the page returns from its postback TheScheduler does not update and I'm not sure why...
  2. Brian King
    Brian King avatar
    23 posts
    Member since:
    Jul 2009

    Posted 25 Oct 2010 Link to this post

    I've tried re-setting all the data and rebinding it after the end of the method, and it still refuses to update. The annoying part about it is that it actually reports the correct values on post back as if it was on a different month than the displayed one. I've tried putting it in an asp:updatePanel but that didn't make any difference either.

    Clicking to change the view on the scheduler after the CalendarSlider_SelectionChanged method is complete does cause TheScheduler to change to the correct date.
  3. Brian King
    Brian King avatar
    23 posts
    Member since:
    Jul 2009

    Posted 25 Oct 2010 Link to this post

    Alright, I tried a bunch of changes that I read from other posts in this thread. I'm not sure which one did it but I'm pretty sure it was setting up an asp:UpdatePanel with just the scheduler inside where the UpdateMode attribute to always.
  4. Answer
    Peter avatar
    6637 posts

    Posted 27 Oct 2010 Link to this post

    Hello Brian,

    We are glad that you were able to solve the problem yourself and apologize that we could not help you right away.

    If you use RadAjaxManager for this case, you should make sure that RadCalendar updates RadScheduler in the ajax settings:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                    <telerik:AjaxSetting AjaxControlID="RadCalendar1">  
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 

    Don't hesitate to contact us if you have other questions.

    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
  5. Brian King
    Brian King avatar
    23 posts
    Member since:
    Jul 2009

    Posted 28 Oct 2010 Link to this post

    Yes, I had try to do this previously but it didn't work. Turns out a Javascript error was being thrown due to the fact that I wasn't implementing the PreRender event, now it's working better than my prior solution.

Back to Top