<asp:Content ID="content" ContentPlaceHolderID="PopupContent" Runat="Server"><script src="../Scripts/Common.js" type="text/javascript" language="javascript"></script> <h1>TestPage</h1> <asp:Panel ID="pnlTest" runat="server"> <asp:TextBox ID="txtTest" runat="server"></asp:TextBox> <asp:Button ID="btnTest" runat="server" OnClick="btnTest_Click" /> </asp:Panel> <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnTest"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="txtTest" /> </UpdatedControls> </telerik:AjaxSetting><%-- <telerik:AjaxSetting AjaxControlID="btnTest"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlTest" /> </UpdatedControls> </telerik:AjaxSetting> --%> </AjaxSettings> </telerik:RadAjaxManagerProxy></asp:Content><telerik:RadScriptBlock runat="server" ID="RadScriptBlock"><script language="javascript" type="text/javascript"> function OnRequestStart(sender, args) { args.set_enableAjax(true); centerAjaxLoadingPanel(); } // Invoke the centerElementOnScreen method to center the ajax loading panel in the screen function centerAjaxLoadingPanel() { centerElementOnScreen($get("<%= PopupAjaxLoadingPanel.ClientID %>")); } // Center the ajax loading panel in the screen function centerElementOnScreen(element) { var scrollTop = document.body.scrollTop; var scrollLeft = document.body.scrollLeft; var viewPortHeight = document.body.clientHeight; var viewPortWidth = document.body.clientWidth; // Check for BackCompat or CSS1Compat ( to display correctly in the older versions of Internet explorer) if (document.compatMode == "CSS1Compat") { viewPortHeight = document.documentElement.clientHeight; viewPortWidth = document.documentElement.clientWidth; } var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2); var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2); var top = scrollTop + topOffset - 40; var left = scrollLeft + leftOffset - 70; element.style.position = "absolute"; element.style.top = top + "px"; element.style.left = left + "px"; }</script></telerik:RadScriptBlock> <telerik:RadScriptManager ID="PopupMasterScriptManager" runat="server" AsyncPostBackTimeout="300" /> <telerik:RadAjaxManager ID="RadAjaxManagerPopup" runat="server" DefaultLoadingPanelID="AjaxLoadingPanel"> <ClientEvents OnRequestStart="OnRequestStart" OnResponseEnd="OnResponseEnd" /> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="PopupAjaxLoadingPanel" runat="server" Height="60px" Width="130px" IsSticky="true" Transparency="1"> <asp:Image ID="imgPopupLoadingPanel" runat="server" AlternateText="Loading..." ImageUrl="~/Images/loading.gif" /> </telerik:RadAjaxLoadingPanel>I am trying to clear the scheduler from codebehind but I am having problems.
RadScheduler1.Appointments.Clear()
looks like it should do what I want, but it does not. If i check RadScheduler1.Appointments.Count before clearing, it says 5. If I check it again AFTER clearing the items, it sais 0. So the items are cleared. But they are still displayed in the scheduler. If I change the viewState of the scheduler from day to week, the items are still there. I do not use a datasource but fill the items from a function. This function does not run after the .Appointments.Clear(). But still the items are there. How do I remove the visible items???
Made a horrible workaround for this. It works, but cannot possibly be the way to do it:
Dim col As New Collection
For Each o As Telerik.Web.UI.Appointment In RadScheduler1.Appointments
col.Add(o)
Next
For Each i As Telerik.Web.UI.Appointment In col
RadScheduler1.DeleteAppointment(i, True)
Next
RadScheduler1.SelectedView = RadScheduler1.SelectedView