Change background color of cell relative to data

3 posts, 0 answers
  1. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 26 Jul 2012 Link to this post

    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.

  2. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 27 Jul 2012 Link to this post

    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.

  3. DevCraft R3 2016 release webinar banner
  4. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 30 Jul 2012 Link to this post

    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.

    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top