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

Change background color of cell relative to data

2 Answers 138 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 26 Jul 2012, 03:31 PM
I have a scheduler control displayed in timeline view, with resources and days.
If a resource (Consultant) is not available for a given day, we want to highlight this by setting the background colour of the intersection of his resource row and the date.

In the example image, no one is available on the 9th of September, and most arent available of the 8th either. However, Geoff Swindell is available on the 8th, but not on the 4th.

Because the CellFormatting event occurs as is drawn and before we have the data, we're having trouble colouring these rows.

Is it possible to format the cells AFTER we have this data?

Events and appointments will be overlaid on top of these dates, even if they're marked as unavailable.

Thank,
Karl

2 Answers, 1 is accepted

Sort by
0
Karl
Top achievements
Rank 1
answered on 27 Jul 2012, 02:05 PM
Yes it is.

Simply get the data that governs which days are to be configured with an alternate background color before binding resources and appointments.

Voila!
0
Ivan Todorov
Telerik team
answered on 30 Jul 2012, 11:11 AM
Hello Karl,

Thank you for your question.

The CellFormatting event is fired each time when you change the view. Therefore, you can force firing the event when you have retrieved your data by replacing the ActiveView with a copy of the current one:
this.radScheduler1.ActiveView = this.radScheduler1.ActiveView.OffsetView(0);

I hope this will help. Please let me know if you need further help.

Regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Scheduler and Reminder
Asked by
Karl
Top achievements
Rank 1
Answers by
Karl
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or