I am using DevExpress 16, am scheduling appointment dynamically using database data. Now, I scheduled my appointment successfully. I need to change appointment label background color programmatically.
I found some coding to change appointment label background color, like this,
Dim labels As AppointmentLabelCollection = schedulerControl1.Storage.AppointmentStorage.Labels
For i As Integer = 0 To labels.Count - 1
Dim currentLabel As AppointmentLabel = labels(i)
If currentLabel.Color = someColor Then
newApt.LabelId = i
Exit For
End If
Next
But, I'm unable to use this code to set the background color, it shows me an error as below:
I believe this above error due to AppointmentStorage disabled during design time (in Properties window of the Scheduler control) itself. Refer the below image:
Any help will be appreciated.
.Color
property. Whether something is disabled at design time or not, shouldn't affect code that you're writing at all. – David Wilson