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

Collor cell according to their class

3 Answers 41 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Dani
Top achievements
Rank 1
Dani asked on 12 Dec 2011, 05:50 PM
I'm getting data from database. I have two tables which create appointments. The classes which represent these tables differ by one boolean variable.

I'm trying to color the cells from one of the table green.

My css is here:
.rsMonthView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsDayView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsWeekView .rsAptContent 
                {  
                  background: #D0ECBB; 
                }
                
                .rsTimelineView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }


How to check which table from is the cell?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 Dec 2011, 05:56 PM
Hi Dani,

You can handle AppointmentDataBound and set the appointment's CssClass property conditionally. Then you can leverage the rendered css to style the appointments uniquely per RadScheduler instance.

Best wishes,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Dani
Top achievements
Rank 1
answered on 13 Dec 2011, 08:58 AM
I added the AppointmentDataBound event but it never gets called.
I put breakpoint in its beginning and it's never hit.
0
Peter
Telerik team
answered on 13 Dec 2011, 03:55 PM
Hi Dani,

AppointmentDataBound will not fire if you use a Web Service to populate RadScheduler. In this case you should handle OnClientAppointmentDataBound like this:
Copy Code
function OnClientAppointmentDataBound(sender, eventArgs) {
var app = eventArgs.get_appointment();
//debugger;
var backColor = app.get_attributes().getAttribute("AppointmentColor");
if (backColor)
app.set_backColor(backColor);
app.set_borderColor("black");
app.set_borderWidth("1");
}

You can download a working sample from here (WebServiceBinding).


Best wishes,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Scheduler
Asked by
Dani
Top achievements
Rank 1
Answers by
Peter
Telerik team
Dani
Top achievements
Rank 1
Share this question
or