Hi Dan,
I'm using MVC Scheduler control (pro - trial) on my page.
I'm trying to change the CssClass of a cell in the OnBeforeCellRender method based of some criteria.
This works well most of the times, but I noticed in one case, the cells are not rendered with the custom css class.
When any one of the cell in the current view has a different class than others, this works (different class for different cell, AND all the cells are rendered as separate divs).
But when the case is such that ALL the cells have the same CssClass for the current view, the class is not rendered at all; infact, the cells are not actually separate divs, instead only one div is rendered for the entire column, separated by horizontal lines.
I'm in the single day view.
// what i'm trying to do
protected override void OnBeforeCellRender(BeforeCellRenderArgs e)
{
var isAvailable = someMethodToGetCondition();
e.CssClass = isAvailable ? "my-scheduler-available" : "my-scheduler-unavailable";
}
To reiterate, during loading of the control, if some cells have different CssClass (because of above), things work good. But when every cell gets the same CssClass value, the class is not rendered, the cells are not rendered as separate divs.
The config I use is this:
Height = 180,
HeightSpec = HeightSpec.Fixed,
StartDate = DateTime.Now,
Days = 1,
CellDuration = 15
CellWidth = 25,
CellGroupBy = GroupBy.Hour,
ViewType = ViewType.Resources,
TimeFormat = TimeFormat.Clock12Hours,
Resources = GetDayPilotResourceCollection(),
CssOnly = true,
CssClassPrefix = "my-scheduler",
EventHeight = 25,
RowHeaderWidth = 120,
TreeEnabled = true,
ContextMenu = "menu",
EventBubble = "bubble",
Separators = new SeparatorCollection
{
new Separator(DateTime.Now, Color.Red)
}
Please let me know if you need to know anything else, or if I'm missing something.
Thanks.