search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to customize X-Axis

Asked by Anonymous
8 years ago.

im using scheduler lite. i managed to display the rooms and room status on the vertical axis, and i want to set a different border color for specific room status. so on my BeforeResHeaderRender i try to do like this

string status = (string)e.DataItem["RoomStatus"];
switch (status)
{
case "Online":
e.CssClass = "status_Online";
break;
case "Offline":
e.CssClass = "status_Offline";
break;
}
but it dont let me use the e.CssClass and it also show an error "object not reference.." for the line string status = (string)e.DataItem["RoomStatus"];

Answer posted by Dan Letecky [DayPilot]
8 years ago.

1. In the Lite version, e.DataItem is only used for ViewType="Gantt". In that case, it stores the event source object (after calling DataBind()). In other modes e.DataItem.Source is null. In the Pro version you can set the source object using DayPilotScheduler.Resources collection.

In the Lite version, you need to lookup the source object using its id (stored in e.Id).

2. Also, e.CssClass is only available in the Pro version.

In the Lite version, you need to use e.Html instead, e.g.:

e.Html = "<div class='my-class'>" + e.Name + "</div>";
Comment posted by Anonymous
8 years ago.

can u give some example on how to lookup the source object using its id (stored in e.Id).
i been trying it all the time but still cant get the room status.
i just want to stored it into the string status so that i can customize it..

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.