AllowDelete=false and other functions

2 posts, 0 answers
  1. Ed
    Ed avatar
    24 posts
    Member since:
    May 2005

    Posted 27 Feb 2012 Link to this post

    I am populating a Rad Scheduler using a WCF services, some of the items cannot be deleted so I have set AllowDelete to be false this does not seem to work and when I hover over the appointment the delete image still appears.

    I have also tried to set some other information based on whether the appointment is a parent or child and this does not seem to work either, see my code below. The subject of the appointment changes to be either "Parent: ...." or "Child: ...." so the IF statement is working correctly. But the other changes I am trying to make do not seem to work correctly.

    Am I adding the appointments incorrectly/is there another way to do this that will work.

    Public Overloads Overrides Function GetAppointments(ByVal Owner As RadScheduler) As IEnumerable(Of Appointment)
         Dim AppointmentsList As New List(Of Appointment)
        'get a list of appointments to add and put them in the list above
        Do While Rs.ReadNext
            Dim AppointmentItem As New Appointment
            AppointmentItem.Start = Slot.Start_DT.Value
            AppointmentItem.End = Slot.End_DT.Value
            AppointmentItem.AllowEdit = False
            AppointmentItem.ID = Slot.GUI.Value
            If Slot.ParentGUI.IsNull Then
                AppointmentItem.Subject = "Parent: " & Slot.Name.Value
                AppointmentItem.AllowDelete = False
                AppointmentItem.ContextMenuID = "SchedulerAppointmentContextMenuDelete"
                AppointmentItem.Subject = "Child: " & Slot.Name.Value
                AppointmentItem.RecurrenceParentID = Slot.ParentGUI.Value
                AppointmentItem.AllowDelete = False
                AppointmentItem.BackColor = System.Drawing.Color.Black
                AppointmentItem.ForeColor = Drawing.Color.Pink
                AppointmentItem.ContextMenuID = "SchedulerAppointmentContextMenuNothing"
                ' have tried this too, AppointmentItem.ContextMenuID = Nothing
            End If
        Return AppointmentsList
    End Function

  2. Plamen
    Plamen avatar
    2723 posts

    Posted 29 Feb 2012 Link to this post

    Hello Andy,

    When RadScheduler populates with WCF services the AppoinmentData object is used and that is why some of the options are not passed when they are set in the provider. That is why I will recommend you to set these settings in the onClientAppoinmentDataBound as it is shown in the last section of the SchedulerAppointment help topic.

    Hope this will be helpful.


    Plamen Zdravkov
    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top