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

How can I change font css for a specific Task Column in Gantt Chart

Asked by Anonymous
7 years ago.

Hi,

I want to change font size, color for main Task Column. How to apply css or change font size, color for specific task column (probably main task).?

Thanks for help in advance.

Regards,

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

Each row header column cell is marked with several CSS classes. One of them is column-specific and includes the column number.

Example: Column #2 (indexed from 0) with the default theme ("gantt_default") uses the following CSS class:

"gantt_default_rowheadercol1"

In addition to that, you can use BeforeTaskRender event handler to specify custom CSS class that will be applied to all row header columns of a given row:

protected override void OnBeforeTaskRender(BeforeTaskRenderArgs e)
{
    if (e.Row.Columns.Count == 3)
    {
        e.Row.CssClass = "my-row";
    }
}

See also:
https://doc.daypilot.org/gantt/row-customization/

Then you can simple add a custom CSS which targets the cell using a combination of those classes:

.gantt_default_rowheadercol1.my-row .gantt_default_rowheader_inner {
  color: #ccc:
  background-color: #fff;
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.