This is a migrated thread and some comments may be shown as answers.

Clearing the Sceduler

1 Answer 62 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jostein
Top achievements
Rank 1
Jostein asked on 07 Oct 2011, 01:13 PM

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

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Oct 2011, 10:11 AM
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
Tags
Scheduler
Asked by
Jostein
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or