Question
Hi. Is it possible to give the rootnodes in the grid another (background) olor than the subnodes?
Answer
You can set different cellLayouts on the different cells, the cellLayouts have a myriad of properties that control the look of the cell.
CellLayout layout=new CellLayout();
layout.MinHeight=20;
layout.Font=new Font(“Microsoft Sans Serif”,10);
layout.FontColor=Color.Black;
layout.VertAlign=StringAlignment.Center;
layout.Name=”layout”;
layout.HeaderBackgroundColor=SystemColors.Control;
layout.HeaderBackgroundGradiantColor=layout.HeaderBackgroundColor;
layout.LineRight.Use=true;
layout.LineRight.Color=SystemColors.ControlDark;
layout.LineTop.Use=false;
layout.LineBottom.Use=false;
gantt1.Grid.CellLayouts.Add(layout);
CellLayout layoutrightjust=new CellLayout();
layoutrightjust.MinHeight=20;
layoutrightjust.LineRight.Use=true;
layoutrightjust.LineRight.Color=SystemColors.ControlDark;
layoutrightjust.LineTop.Use=false;
layoutrightjust.LineBottom.Use=false;
layoutrightjust.Font=new Font(“Microsoft Sans Serif”,10);
layoutrightjust.FontColor=Color.Black;
layoutrightjust.Name=”layoutrightjust”;
layoutrightjust.HorzAlign=StringAlignment.Far;
layoutrightjust.VertAlign=StringAlignment.Center;
layoutrightjust.HeaderBackgroundColor=layout.HeaderBackgroundColor;
layoutrightjust.HeaderBackgroundGradiantColor=layout.HeaderBackgroundColor;
gantt1.Grid.CellLayouts.Add(layoutrightjust);