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
<script type="javascipt"> function DoFrameSize(){ doBody(); } Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; } Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; }<script><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAsyncUpload1"> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" MultipleFileSelection="Automatic" OnClientFileSelected="DoFrameSize" ForeColor="Black"> <Localization Select="Add Files" /></telerik:RadAsyncUpload><telerik:RadProgressArea runat="server" ID="RadProgressArea1"></telerik:RadProgressArea> </div>private void shareGoogle(int ProductId){ //url for sample purpose string url = "http://www.telerik.com/"; StringBuilder script = new StringBuilder(); script.Append("<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\"></script>"); script.Append("<g:plusone"); script.Append(" size=\"standard\""); script.Append(" count=\"false\""); script.AppendFormat(" href=\"{0}\"", url); script.Append("></g:plusone>"); ltGoogle.Text = script.ToString();}<div style="float:left; width:285px;"><asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <telerik:RadListBox ID="rlb1" runat="server" AllowTransfer="true" EnableDragAndDrop="true" TransferMode="Copy" TransferToID="rlb2" SelectionMode="Multiple" ButtonSettings-VerticalAlign="Middle" ButtonSettings-ShowTransferAll="false" AllowTransferOnDoubleClick="true" Height="300px" Width="100%"></telerik:RadListBox> </ContentTemplate> </asp:UpdatePanel>
</div><div style="float:left; width:285px; padding:0px 0px 0px 10px;"> <asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <telerik:RadListBox ID="rlb2" runat="server" EnableDragAndDrop="true" AllowReorder="true" AllowDelete="true" AllowTransferDuplicates="false" ButtonSettings-VerticalAlign="Middle" Height="300px" Width="100%"></telerik:RadListBox> </ContentTemplate> </asp:UpdatePanel> </div>