Objective Grid: Using a drop down list as a header

Article ID: 699
Last updated: 11 Jun, 2018
Article ID: 699
Last updated: 11 Jun, 2018
Revision: 3
Views: 1850
Posted: 12 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How do I use a drop down list as a header?


Cause



Action


You can do it like this:

// Apply combobox to a specific header
SetStyleRange(CGXRange(0,nCol),
CGXStyle( )
.SetControl(GX_IDS_CTRL_CBS_DROPDOWNLIST)
.SetHorizontalAlignment(DT_CENTER)
.SetWrapText(FALSE)
.SetVerticalAlignment(DT_VCENTER)
.SetFont(CGXFont( ).SetBold(TRUE))
.SetChoiceList("Dan D. Bob L. Gail J. Jean J. Bill B. Bob M.")
.SetValue("Photographers")
);
// - Or -

// Apply combobox to all headers

RowHeaderStyle( )
.SetControl(GX_IDS_CTRL_CBS_DROPDOWNLIST)
.SetHorizontalAlignment(DT_CENTER)
.SetWrapText(FALSE)
.SetVerticalAlignment(DT_VCENTER)
.SetFont(CGXFont( ).SetBold(TRUE))
.SetChoiceList("Dan D. Bob L. Gail J. Jean J. Bill B. Bob M.")
.SetValue("Photographers")
);

You need to also turn off selecting whole columns when clicking on a column header (see also: 'How can I disable users selecting cells with the mouse?’).

This article was:   Helpful | Not helpful
Report an issue
Article ID: 699
Last updated: 11 Jun, 2018
Revision: 3
Views: 1850
Posted: 12 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category