or
I have a requirement in which I need to hide the recurrence check box form the Edit Appointment dialog. I wonder if this is possible
Thank you
J
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Panel ID="pnlDefaultButtonSupport" runat="server" DefaultButton="btnOk"><fieldset class="noborder" style="width: 780px;"> <telerik:RadSchedulerRecurrenceEditor runat="server" ID="rscr"> </telerik:RadSchedulerRecurrenceEditor> </fieldset><div class="ActionContainerNoBottom" style="width: 780px"> <asp:Button ID="btnOk" runat="server" Text="Save" SkinID="CommandButton"/> <asp:Button ID="btnClose" runat="server" Text="Close" PostBackUrl="javascript:GetRadWindow().close();" SkinID="CommandButton" CausesValidation="false"/></div></asp:Panel><telerik:RadWindowManager ID="rwmRecord" runat="server" Height="500" Width="900" ShowOnTopWhenMaximized="false" Behaviors="Close,Move,Resize,Maximize,Reload,Minimize" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" EnableShadow="true" OnClientClose="OnClientClose" OnClientCommand="OnClientCommand">protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) { // checking if the current time slot is blocked if (TimeSlotBlocked(e.TimeSlot.Resource.Key.ToString(), e.TimeSlot.Start, e.TimeSlot.End)) { e.TimeSlot.CssClass = "Disabled"; } }protected bool TimeSlotBlocked(String pt, DateTime dt1, DateTime dt2) { foreach (PTBlockedTime bt in blockedTime) { if ((pt == bt.PersonalTrainerId) && ((dt1.AddMinutes(+1) >= bt.Start && dt1.AddMinutes(+1) <= bt.End) || (dt2.AddMinutes(-1) >= bt.Start && dt2.AddMinutes(-1) <= bt.End))) { return true; } } return false; }public struct PTBlockedTime { public String PersonalTrainerId; public DateTime Start; public DateTime End; public PTBlockedTime(String pt, DateTime dt1, DateTime dt2) { PersonalTrainerId = pt; Start = dt1; End = dt2; } } . . . List<PTBlockedTime> blockedTime = new List<PTBlockedTime>();DateTime aux1 = new DateTime(2012, 1, 25, 8, 0, 0); DateTime aux2 = new DateTime(2012, 1, 25, 10, 0, 0); PTBlockedTime aux = new PTBlockedTime("575204", aux1, aux2); blockedTime.Add(aux);
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { //add the new appointment to the db int? recurrentParentId = null; if (e.Appointment.RecurrenceParentID != null) recurrentParentId = (int)e.Appointment.RecurrenceParentID; AppointmentManager.AddUserAppointment( UserId, 1, e.Appointment.Start, e.Appointment.End, e.Appointment.RecurrenceRule, recurrentParentId, e.Appointment.Description, e.Appointment.Subject); BindSchedule(); }mySchedule.DataSource = GetSchedule(); //calls the database and gets the appointmentsmySchedule.DataBind();<telerik:RadScheduler runat="server" ID="mySchedule" DayStartTime="08:00:00" DayEndTime="22:00:00" StartInsertingInAdvancedForm="true" ShowNavigationPane="true" OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentDelete="RadScheduler1_AppointmentDelete" DataKeyField="AppointmentId" DataSubjectField="Subject" DataDescriptionField="Description" DataStartField="Start" DataEndField="EndX" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" FirstDayOfWeek="Monday" ShowHeader="true" ShowFooter="false"> <AdvancedForm Modal="true" /> <DayView UserSelectable="false" /> <WeekView UserSelectable="false" /> <MonthView UserSelectable="false" /> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> <ResourceTypes> <telerik:ResourceType KeyField="ID" Name="Type" TextField="Keyword" ForeignKeyField="AppointmentTypeID" DataSourceID="AppointmentTypesDataSource" /> </ResourceTypes> <ResourceStyles> <telerik:ResourceStyleMapping Type="Type" Text="Event" ApplyCssClass="rsCategoryGreen" /> <telerik:ResourceStyleMapping Type="Type" Text="Personal" ApplyCssClass="rsCategoryBlue" /> <telerik:ResourceStyleMapping Type="Type" Text="Meeting" ApplyCssClass="rsCategoryYellow" /> </ResourceStyles> <AppointmentTemplate> <!--narrowed down template--> <div > <h2> <%# Eval("Subject") %> </h2> <div> </div> </div> </AppointmentTemplate></telerik:RadScheduler> <script type="text/javascript"> function RedirectUser(sender, args) { GetRadWindow().BrowserWindow.location.href = '../ThisPageWhenRedirectUser.aspx'; GetRadWindow().close(); //closes the window } function GetRadWindow() //Get reference to window { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; return oWindow; } </script>'after database has retrieved and stored the value in sessionIf (Session("UserType") = Something Then CloseRadAndRedirect()Public Sub CloseRadAndRedirect() If (Not ClientScript.IsStartupScriptRegistered("GetRadWindow")) Then ScriptManager.RegisterStartupScript(Page, Me.GetType(), "GetRadWindow", "RedirectUser();", True) End If End Sub