Hi,
Based on appointment type, I need to display the appointments in different colors.
My "GetAppointments" method looks like this:
Public
Overrides
Function
GetAppointments(
ByVal
p_oSchedulerInfo
As
ISchedulerInfo)
As
IEnumerable(Of Appointment)
Dim
l_oScheduleInfo = TryCast(p_oSchedulerInfo, wsScheduleInfo)
Dim
l_sScheduleIDs
As
String
= l_oScheduleInfo.ScheduleIDs
Dim
l_aAppointments
As
New
List(Of Appointment)()
Using l_oDP
As
New
wsDataProvider
Using l_oSystem
As
New
wsSystemGeneral(l_oDP)
Dim
l_sSql
As
String
=
"select * from `PlanningTaskBlocks` where `numScheduleID` in ("
& l_sScheduleIDs &
") order by `numTaskID` asc"
Using l_oDR
As
IDataReader = l_oDP.ExecuteReader(l_sSql)
If
l_oDR IsNot
Nothing
Then
Dim
l_oAppointment
As
Appointment =
Nothing
, l_iTaskID
As
Long
= 0
Dim
l_sTask
As
String
=
Nothing
, l_sColor
As
String
=
Nothing
, l_iAgeMin
As
Integer
= 18, l_iAgeMax
As
Integer
= 99, l_sGender
As
String
=
"X"
While
l_oDR.Read
If
l_iTaskID <> l_oDR(
"numTaskID"
)
Then
Using l_oDRtask
As
IDataReader = l_oDP.ExecuteReader(
"select * from `PlanningTasks` where `ID` = "
& l_oDR(
"numTaskID"
) &
" limit 1"
)
If
l_oDRtask IsNot
Nothing
Then
If
l_oDRtask.Read
Then
l_sTask = l_oDRtask(
"txtName"
)
l_sColor = l_oDRtask(
"txtColor"
)
l_iAgeMin = l_oDRtask(
"numAgeMin"
)
l_iAgeMax = l_oDRtask(
"numAgeMax"
)
l_sGender = l_oDRtask(
"txtGender"
)
End
If
If
Not
l_oDRtask.IsClosed
Then
l_oDRtask.Close()
End
If
End
Using
l_iTaskID = l_oDR(
"numTaskID"
)
End
If
l_oAppointment =
New
Appointment
l_oAppointment.ID = l_oDR(
"ID"
)
l_oAppointment.Subject = Convert.ToString(l_sTask)
l_oAppointment.Start = DateTime.SpecifyKind(Convert.ToDateTime(l_oDR(
"dateStart"
)), DateTimeKind.Utc)
l_oAppointment.[
End
] = DateTime.SpecifyKind(Convert.ToDateTime(l_oDR(
"dateEnd"
)), DateTimeKind.Utc)
l_oAppointment.BackColor = System.Drawing.ColorTranslator.FromHtml(l_sColor)
l_oAppointment.Attributes(
"TaskID"
) = Convert.ToString(l_oDR(
"numTaskID"
))
l_oAppointment.Attributes(
"TaskPoints"
) = Convert.ToString(l_oDR(
"numTaskPoints"
))
l_oAppointment.Attributes(
"NumberOfPlaces"
) = Convert.ToString(l_oDR(
"numNumberOfPlaces"
))
l_oAppointment.Attributes(
"AgeMin"
) = Convert.ToString(l_iAgeMin)
l_oAppointment.Attributes(
"AgeMax"
) = Convert.ToString(l_iAgeMax)
l_oAppointment.Attributes(
"Gender"
) = Convert.ToString(l_sGender)
'LoadResources(l_oAppointment)
l_aAppointments.Add(l_oAppointment)
End
While
If
Not
l_oDR.IsClosed
Then
l_oDR.Close()
End
If
End
Using
End
Using
End
Using
Return
l_aAppointments
End
Function
As you can see, I'm setting the BackColor property on every Appointment instance.
However, the Appointment.BackColor property is ignored and all appointsments are displayed with the same color in the RadScheduler.
What do I need to do to 'push' my custom colors through the webservice to the scheduler?