I have a radscheduler on a webform and have this code. It is probably something really stupid that I can't see so here goes.
I have a table of users and schedules. The users have a named colour stored in the table.
What I am try to achieve?
I am tried to get all the schedules for the users and make their appointments show up in the specified colour stored in the database.
I have a small issue of retaining the correct colour as all the other colours are overwritten by the last loop.
Example.
User1 ----- Red
User2 ----- Blue
When the Schedule is rendered all the items are blue. Is there a way around this? Or am I making a schoolboy error? I hnave already tried the same code on AppointmentOnDataBound
Can someone please tell me why the second colour overwrites the first colour
I have a table of users and schedules. The users have a named colour stored in the table.
What I am try to achieve?
I am tried to get all the schedules for the users and make their appointments show up in the specified colour stored in the database.
I have a small issue of retaining the correct colour as all the other colours are overwritten by the last loop.
Example.
User1 ----- Red
User2 ----- Blue
When the Schedule is rendered all the items are blue. Is there a way around this? Or am I making a schoolboy error? I hnave already tried the same code on AppointmentOnDataBound
protected
void
EngSchedule_AppointmentCreated(
object
sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)
{
DataTable table = PageAccess.GetEngSchedule();
foreach
(DataRow dataRow
in
table.Rows)
{
var c = dataRow[
"Colour"
].ToString(); //first colour Red, second colour Blue
e.Appointment.BackColor = Color.FromName(c); // Appointments always blue WHY??
}
}
Can someone please tell me why the second colour overwrites the first colour