Hello,
I am using RadScheduler in ASP.NET MVC - WebService binding. I am setting culture in OnLoad event, but this setting is reverted to English culture after some time (usually 2-3s). I observed, that it happens after my SchedulerProvider method GetAppointments(RadScheduler owner) is called, but not sure.
Do You have any clue what is wrong with that?I am stuck on this for a while.
Thank You
Here is my sample code:
I am using RadScheduler in ASP.NET MVC - WebService binding. I am setting culture in OnLoad event, but this setting is reverted to English culture after some time (usually 2-3s). I observed, that it happens after my SchedulerProvider method GetAppointments(RadScheduler owner) is called, but not sure.
Do You have any clue what is wrong with that?I am stuck on this for a while.
Thank You
Here is my sample code:
<script runat="server"> |
protected override void OnLoad(EventArgs e) |
{ |
// Set appropriate culture for calendar |
RadScheduler1.Culture = CRM.Web.Code.Globalization.GlobalizationManager.CurrentUICulture; |
// Set first and last day of a week |
switch (RadScheduler1.Culture.ToString()) |
{ |
case "en-US": |
RadScheduler1.FirstDayOfWeek = DayOfWeek.Sunday; |
RadScheduler1.LastDayOfWeek = DayOfWeek.Saturday; |
break; |
default: |
RadScheduler1.FirstDayOfWeek = DayOfWeek.Monday; |
RadScheduler1.LastDayOfWeek = DayOfWeek.Sunday; |
break; |
} |
RadScheduler1.ShowAllDayRow = Model.ShowAllDayEvents; |
RadScheduler1.WorkDayStartTime = Model.WorkDayStartTime; |
RadScheduler1.WorkDayStartTime = Model.WorkDayEndTime; |
RadScheduler1.DayStartTime = Model.DayStartTime; |
RadScheduler1.DayEndTime = Model.DayEndTime; |
// Export iCalendar |
SchedulerAppointmentContextMenu.Items[0].Text = "ExportICalendar".GetLocalizedGlobal(); |
// Delete |
SchedulerAppointmentContextMenu.Items[2].Text = "Delete".GetLocalizedGlobal(); |
base.OnLoad(e); |
} |
public override void VerifyRenderingInServerForm(Control control) |
{ |
} |
</script> |
<telerik:RadCodeBlock runat="server" ID="InitialScriptCodeBlock1"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" |
EnableScriptGlobalization="true" /> |
<telerik:RadScheduler runat="server" ID="RadScheduler1" AllowDelete="false" AllowEdit="true" RowHeight="16px" |
AllowInsert="false" MinutesPerRow="15" StartEditingInAdvancedForm="false" StartInsertingInAdvancedForm="false" |
OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick" OnClientTimeSlotClick="OnClientTimeSlotClick" OnClientAppointmentWebServiceUpdating="" |
OnClientAppointmentDeleting="OnClientAppointmentDeleting" OnClientAppointmentDataBound="OnClientAppointmentDataBound" |
Height="900px" OnClientAppointmentEditing="OnClientAppointmentEditing" OnClientAppointmentContextMenuItemClicked="appointmentContextMenuItemClicked" |
SelectedView="WeekView" DayHeaderDateFormat="dddd, dd MMMM yyyy" HoursPanelTimeFormat="HH:mm"> |
<AppointmentContextMenus> |
<%--The appointment context menu interaction is handled on the client--%> |
<%--See the JavaScript code above--%> |
<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu"> |
<Items> |
<telerik:RadMenuItem Text="Export iCalendar" Value="GenerateVCal" ImageUrl="~/Content/Images/Icons/iCalendar16.png" /> |
<telerik:RadMenuItem IsSeparator="True" /> |
<telerik:RadMenuItem Text="Delete" Value="CommandDelete" ImageUrl="~/Content/Images/DataEditing/Delete.gif" |
Enabled="True" /> |
</Items> |
</telerik:RadSchedulerContextMenu> |
</AppointmentContextMenus> |
<TimelineView GroupBy="Calendar" GroupingDirection="Vertical" /> |
<AdvancedForm Enabled="false" EnableResourceEditing="false" /> |
<WebServiceSettings Path="~/Models/SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" /> |
</telerik:RadScheduler> |
</telerik:RadCodeBlock> |