10663 : Customize the grid rows with image or color.

Question

I’d like to know if it is possible, using ActiveX version, to customize the grid rows with image or color.

Answer

Each cell can be assigned its own CellLayout (IphGridLayoutPropX). In this object you can set properties as BackColor (and font, frame and align options ).

It is currently only possible to assign an image to a Cell when it shows the tree expand/collapse buttons. The image is then controlled with the properties IphDataEntity_Tree2.ImageIndex and IphDataEntity_Tree2.SelectedIndex.

10033 : Id like to put my own labels inside the headers of each column.

Question

Id like to put my own labels inside the headers of each column.
Is this possible?  How?

Thanks.

 

Answer

When you define you columns you set the Title property;

            GridColumn c_st=gantt1.Grid.Columns.AddNew(CellType.SingleText);
            GridColumn c_mt=gantt1.Grid.Columns.AddNew(CellType.MultiText);
            GridColumn c_td=gantt1.Grid.Columns.AddNew(CellType.TimeDate);

            c_st.Title=“SingleText”;
            c_mt.Title=“MultiText”;
            c_td.Title=“TimeDate”;

You can then control how the column headers are rendered by assigning CellLayouts. The simple way to assign a named CellLayout to the complete column is to set the gantt1.Grid.Columns.LayoutName to the name of an existing CellLayout in the Gantt.Grid.CellLayouts collection.

A more advanced way, that allows you to have unique CellLayouts all cells, including header cells, is to in runtime assign a CellLayout object the the Cell.Layout property. For header cells you reach the cell object via the Column object; GridColumn.ColumnCell.

You can also inject html code in the headers or in any cell by assigning them values with html snippets in them; like instead of col.Title=”the title” you can set col.Title=”<b>the title</b>”…