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

AllowDelete=false and other functions

1 Answer 26 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 2
Ed asked on 27 Feb 2012, 03:37 PM

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
 
        Slot.Fill(Rs.ReadRow)
 
        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"
 
        Else
            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
 
        AppointmentsList.Add(AppointmentItem)
 
    Loop
 
    Rs.Close()
 
    Return AppointmentsList
 
End Function

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 29 Feb 2012, 06:07 PM
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.

Regards,

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.
Tags
Scheduler
Asked by
Ed
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or