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

Interacting between RadCalendar and RadScheduler

4 Answers 193 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brian King
Top achievements
Rank 1
Brian King asked on 22 Oct 2010, 09:33 PM
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...

4 Answers, 1 is accepted

Sort by
0
Brian King
Top achievements
Rank 1
answered on 25 Oct 2010, 04:50 PM
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.
0
Brian King
Top achievements
Rank 1
answered on 25 Oct 2010, 05:54 PM
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.
0
Accepted
Peter
Telerik team
answered on 27 Oct 2010, 12:55 PM
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">  
            <AjaxSettings
                <telerik:AjaxSetting AjaxControlID="RadCalendar1">  
                    <UpdatedControls
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
                    </UpdatedControls
                </telerik:AjaxSetting
            </AjaxSettings
        </telerik:RadAjaxManager

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


Greetings,
Peter
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
0
Brian King
Top achievements
Rank 1
answered on 28 Oct 2010, 07:05 PM
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.

Thanks!
Tags
Scheduler
Asked by
Brian King
Top achievements
Rank 1
Answers by
Brian King
Top achievements
Rank 1
Peter
Telerik team
Share this question
or