The row headers can be customized using the onBeforeRowHeaderRender
event.
JavaScript
Use onBeforeRowHeaderRender event.
Example
gantt.onBeforeRowHeaderRender = function(args) {
var duration = new DayPilot.TimeSpan(args.task.end().getTime() - args.task.start().getTime());
var html = duration.toString("d") + "d " + duration.toString("h") + "h";
args.row.columns[2].html = html;
};
See also:
ASP.NET WebForms
Use BeforeTaskRender event.
-
e.Row will let you specify the properties related to the task row header.
-
e.Box will let you specify the properties related to the task box.
e.Box properties:
-
Areas
-
BackgroundColor
-
BubbleHtml
-
Columns
-
ContextMenuClientName
-
CssClass
-
Expanded
-
Html
-
MarginBottom
-
MinHeight
-
MoveEnabled
-
ToolTip
Example
void DayPilotGantt1_BeforeTaskRender(object sender, BeforeTaskRenderEventArgs e)
{
e.Row.CssClass = "important_task";
}
ASP.NET MVC
Example
protected override void OnBeforeTaskRender(BeforeTaskRenderArgs e)
{
if (e.Row.Columns.Count == 3)
{
e.Row.Columns[2].Html = (e.End - e.Start).ToString();
}
}