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

[Solved] Navigation doesn't work when scheduler is in a dynamically loaded user control

1 Answer 116 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 20 Jul 2009, 07:00 PM
I'm having a problem with the navigation functionality of the RadScheduler.  I'm using Q1 2009 SP2 (version 2009.1.527).

I have been using the scheduler on my site for many months now without problems.  However, I have recently changed the site by placing the RadScheduler into a custom web user control.  This user control is dynamically loaded when the user clicks a node in a RadTreeView.  So the 2 changes are that the scheduler is in a user control and the user control is dynamically loaded.

The initial load of the user control works correctly.  The problem occurrs when I use the left and right arrows in the navigation panel to go to different months.  I am unable to get more than 1 month away from the current month.  So for example, if the current month is July, I can click the right arrow to go to August, but clicking the right arrow again only reloads August instead of going to September.  Interestingly, this issue does not occurr if I use the pop up RadCalendar for navigation.

Also, I should mention that I'm using the VisibleRangeStart and VisibleRangeEnd properties to only load the "in view" appointments.  By tracing through the code, I can see that properties do not have the correct values when I use the left and right arrows for navigation.

Any thoughts on how to fix this?  I think the problem may be that the RadScheduler's ViewState is not being preserved properly.

1 Answer, 1 is accepted

Sort by
0
Justin
Top achievements
Rank 1
answered on 20 Jul 2009, 08:22 PM
I was able to figure this out.  The problem was that I was calling the following method on every postback from within the Page_Load event.  Prior to having the scheduler in a user control, I only had to call this method on the initial page load.  I guess setting the FirstDayOfWeek and LastDayOfWeek properties can interfere with navigation.  I was able to get around this by overriding the OnInit event and calling localizeRadScheduler1() from there.

 

private void localizeRadScheduler1()

 

{

 

    String UserName = getUserName();

 

 

    String UserDomain = getUserDomain();

 

 

    GenericUser myUser = getMyUser(UserName, UserDomain);

 

 

    DataTable weekend = CommonData.Instance.GetWeekendByCountryCode(myUser.Country);

 

 

    DayOfWeek firstDayOfWeek = getDayOfWeek(weekend.Rows[0]["first_day_of_week"].ToString());

 

 

    DayOfWeek lastDayOfWeek = getDayOfWeek(weekend.Rows[0]["last_day_of_week"].ToString());

 

 

    DateTime selectedDate = DateTime.Now.AddHours(myUser.TimeZoneOffset);

 

    RadScheduler1.FirstDayOfWeek = firstDayOfWeek;

    RadScheduler1.LastDayOfWeek = lastDayOfWeek;

    RadScheduler1.SelectedDate = selectedDate;

}

Tags
Scheduler
Asked by
Justin
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Share this question
or