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

How to set a special color for actual date in Gantt?

Asked by Roger
9 years ago.

I need to set a special color for the actual date in Gantt.

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

There are two options:

1. You can add a separator:

DayPilotGantt1.Separators.Add(DateTime.Today, Color.Red);

2. You can change the background color of the cells:

protected void DayPilotGantt1_BeforeCellRender(object sender, DayPilot.Web.Ui.Events.Gantt.BeforeCellRenderEventArgs e)
{
  if (e.Start <= DateTime.Today && DateTime.Today < e.End) {
    e.BackgroundColor = Color.Red;
  }
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.