Clearing the Sceduler

2 posts, 0 answers
  1. Jostein
    Jostein avatar
    16 posts
    Member since:
    Oct 2011

    Posted 07 Oct 2011 Link to this post

    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

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 09 Oct 2011 Link to this post

    Hi Jostein,

    You need to use the DeleteAppointment method to permanently commit the changes. Your workaround is the correct way to achieve removing of the appointments permanently.


    All the best, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top