Hello,
I try to color "isAllDay" event.
The simpliest way for me to do somethiong like this:
// Couleur isAllDay
r.Add(m => m.IsAllDay)
.Title("Supprimé")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(new[] {
new { Text = "Journée", Value = 1 , Color = "red" },
});
But it's not working. I also tried Convert.ToBoolean(1), but it the same issues.
Do you have any advice ?
Thank you
5 Answers, 1 is accepted
One way to achieve similar behavior is to use the dataBound event of the widget and change the color of the allday events as for example it is done here.
Regards,
Plamen
Telerik by Progress
Hi, reopening an old post here, I tried the sample code for setting the background color of the event on dataBound event but in a recurring event only the first event in the occurrence is set to red background.Each event has a unique id, is this an issue with recurring events? Is there a workaround?
function scheduler_dataBound(e) {
//Handle the dataBound event.
var view = this.view();
var events = this.dataSource.view();
var eventElement;
var event;
for (var idx = 0, length = events.length; idx < length; idx++) {
event = events[idx];
//get event element
eventElement = view.element.find("[data-uid=" + event.uid + "]");
//if (event.IsPublished) {
// eventElement.css("background-color", "green");
//}
//else {
// //set the backgroud of the element
// eventElement.css("background-color", "red");
//}
eventElement.css("background-color", "red");
}
}
In such case we may use the dataItems instead of the events as for example in this dojo.
Regards,
Plamen
Progress Telerik
It seems like I have changed the dojo in the last minute before sending it - please excuse me for that. Here is a runnable dojo that worked correctly at my side
Regards,
Plamen
Progress Telerik