Objective Grid: Formatting a column of cells

Article ID: 547
Last updated: 16 Apr, 2018
Article ID: 547
Last updated: 16 Apr, 2018
Revision: 3
Views: 1653
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


How can I format all cells in a column except the headers? The columns setting should be automatically applied to new rows when they are added at runtime


Cause



Action


You can specify default settings for individual columns with SetStyleRange() when you specify a column range. A column range is created with CGXRange().SetCols(nFromCol, nToCol). When new rows are added to the grid the setting will be automatically applied to the new row.

Here is an example how to use SetStyleRange() for a column range:

// Apply checkbox to all cells in column.
SetStyleRange(CGXRange( ).SetCols(nCol),
CGXStyle()
.SetControl(GX_IDS_CTRL_CHECKBOX3D)
.SetChoiceList(_T("Checkbox"))
);

You can do the same with row ranges.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 547
Last updated: 16 Apr, 2018
Revision: 3
Views: 1653
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category