11010 : Is there a way to show more than one header-line (more than one column) and / or mantain the Cell layout in the header?

Question


We have an application that shows more than a single collumn in the Grid, and each Cell in a different colour, but when switching to Schedule Mode, the colours and other columns are not shown in the header. Is there a way to show more than one header-line (more than one column) and / or mantain the Cell layout in the header? Thank you.

 

Answer


You can change the header cell layout by setting the GridColumn.ColumnCell.CellLayout to the CellLayout of your choice. The header cells use the HeaderBackgroundColor, HeaderBackgroundGradiantColor  properties for colors, besides that they work the same way.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

10667 : Is it possible to have different font color for Header and the cell?

Question

Hi, Is it possible to have different font color for Header and the cell. If I set property in the celllayout it applies to whole of grid. I want to apply different font colors to the headers and the cell.

Answer

Yes. You can assign a unique CellLayout to each cell. The Column heads can also be treated as cells: GridColumn.ColumnCell so you can assign CellLayouts to them to.

You can find a CellLayout from a CellLayoutName like this Grid.CellLayouts.GetFromName(“theNameOfTheCellLayout”);

This sample shows how a header cell in Gantt_ASP is given a Bold type face:

CellLayout cl=new CellLayout();
cl.Name=
“ABoldCellLayout”;
cl.Font=
new Font(FontFamily.GenericSerif,14,FontStyle.Bold);

Gantt_ASP_Vendor.Gantt.Grid.CellLayouts.Add(cl);

// When using Gantt_ASP it is even more important to add the cellLayout to this collection, or else it will not we added to the css

Gantt_ASP_Vendor.Gantt.Grid.Columns[0].ColumnCell.Layout=Gantt_ASP_Vendor.Gantt.Grid.CellLayouts.GetFromName(

“ABoldCellLayout”);