I'm using querry optimization to return data for a particular date range on the schedule. When I click on the left or right arrow the page is not rebiding the data. I have to click to go button to get the scheduler to rebind. Below is the code I'm using. From all of the examples I've seen this should be working properly but it's not.
<telerik:RadScheduler ID="RadScheduler1" runat="server" Width="900px" TimelineView-NumberOfSlots="5" |
Skin="Default" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="false" |
GroupingDirection="Vertical" OnAppointmentDelete="RadScheduler1_AppointmentDelete" |
OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" |
OnFormCreating="RadScheduler1_FormCreating" OnDataBound="RadScheduler1_OnDataBound" |
OnNavigationComplete="RadScheduler1_NavigationComplete" StartInsertingInAdvancedForm="True" |
AdvancedForm-ZIndex="2000" AdvancedForm-Modal="True"> |
<MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" /> |
<TimelineView SlotDuration="12:00:00" NumberOfSlots="10" TimeLabelSpan="2" /> |
<ResourceTypes> |
<telerik:ResourceType DataSourceID="edsUsers" ForeignKeyField="UserID" KeyField="UserID" |
Name="User Name" TextField="UserName" /> |
</ResourceTypes> |
<ResourceTypes> |
<telerik:ResourceType DataSourceID="edsClients" ForeignKeyField="ClientID" KeyField="ClientID" |
Name="Client Name" TextField="ClientName" /> |
</ResourceTypes> |
<ResourceTypes> |
<telerik:ResourceType DataSourceID="edsCategories" ForeignKeyField="CategoryID" KeyField="CategoryID" |
Name="Category" TextField="Category" /> |
</ResourceTypes> |
<ResourceStyles> |
<telerik:ResourceStyleMapping Type="Category" Text="Out of Office" ApplyCssClass="rsCategoryViolet" /> |
<telerik:ResourceStyleMapping Type="Category" Text="After Hours" ApplyCssClass="rsCategoryRed" /> |
<telerik:ResourceStyleMapping Type="Category" Text="Projects" ApplyCssClass="rsCategoryDarkGreen" /> |
<telerik:ResourceStyleMapping Type="Category" Text="MACs" ApplyCssClass="rsCategoryGreen" /> |
<telerik:ResourceStyleMapping Type="Category" Text="VNMS" ApplyCssClass="rsCategoryDarkBlue" /> |
<telerik:ResourceStyleMapping Type="Category" Text="IPT/Engineering" ApplyCssClass="rsCategoryDarkRed" /> |
<telerik:ResourceStyleMapping Type="Category" Text="Other" ApplyCssClass="rsCategoryOrange" /> |
</ResourceStyles> |
<TimeSlotContextMenuSettings EnableDefault="true" /> |
<AppointmentContextMenuSettings EnableDefault="true" /> |
</telerik:RadScheduler> |
</telerik:RadAjaxPanel> |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!IsPostBack) |
{ |
ddlView.SelectedIndex = 1; |
RadScheduler1.SelectedView = SchedulerViewType.TimelineView; |
RadScheduler1.SelectedDate = DateUtilities.GetStartOfCurrentWeekMonday(); |
BindSchedule(); |
} |
RadScheduler1.GroupBy = RadComboBox1.SelectedValue; |
} |
private void BindSchedule() |
{ |
RadScheduler1.DataSource = TED.BLL.Appointment.Appointments(SafeValue.SafeInt(ddlView.SelectedValue),SafeValue.SafeInt(ddlCategory.SelectedValue),SafeValue.SafeInt(ddlClientName.SelectedValue),Users,RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd); |
RadScheduler1.DataKeyField = "ID"; |
RadScheduler1.DataStartField = "Start"; |
RadScheduler1.DataEndField = "End"; |
RadScheduler1.DataSubjectField = "Subject"; |
RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID"; |
RadScheduler1.DataRecurrenceField = "RecurrenceRule"; |
RadScheduler1.DataBind(); |
} |
protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e) |
{ |
RadScheduler scheduler1 = (RadScheduler)sender; |
if (e.Command == SchedulerNavigationCommand.SwitchToMonthView) |
{ |
scheduler1.OverflowBehavior = OverflowBehavior.Expand; |
} |
else |
{ |
scheduler1.OverflowBehavior = OverflowBehavior.Scroll; |
} |
BindSchedule(); |
} |