GanttView columns style

Originally Posted 25 July 2017, 3:23 am EST

  • Originally Posted 25 July 2017, 3:23 am EST

    How is it possible to set a back color for a GanttView grid column (custom column)?
    A sample: I like to give users the information that a column contains a calculated value and is not writable.

    This code doesn't work:
    C1FlexGrid grid = ganttCtrl.Controls[2] as C1FlexGrid;
    grid.Cols[2].Style.BackColor = System.Drawing.Color.LightGray;
  • Marked as Answer



    In order to set background colour of CustomFieldColumn, you can create a FieldStyle and add it to FieldStyles of all the tasks, for the specific custom field as follows :
    FieldStyleCollection fs = new FieldStyleCollection();
    fs.AddFieldStyle(StyleField.CustomField, "Column1");
    fs[0].BackColor = Color.LightSteelBlue;
    foreach (C1.Win.C1GanttView.Task t in c1GanttView1.Tasks)

    You can also refer to the attached sample, demonstrating the same.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels