How are you supposed to set up column headers in ListBox.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-04-18
10:09 PM
- last edited on
‎2023-08-02
02:44 PM
by
Doreena Deng
‎2013-04-18
10:09 PM
I'm trying to make a ListBox that shows multiple columns. I can get that much working but I can only seem to put a header on the first column. Here's my code:
DGListSetHeaderItemCount(dialogID, ResultsList, 2);
DGListSetHeaderFlags(dialogID, ResultsList, true, false, false);
DGListSetHeaderItemFlags(dialogID, ResultsList, 1, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 1, "Property");
DGListSetHeaderItemFlags(dialogID, ResultsList, 2, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 2, "Value");
//set up the columns
w = DGListGetItemWidth(dialogID, ResultsList);
DGListSetTabFieldCount (dialogID, ResultsList, 2); //two columns in the data
DGListSetTabFieldData(dialogID, ResultsList, 1, 0, w/2-1, DG_IS_LEFT, DG_IS_NOTRUNC, true, true);
DGListSetTabFieldData(dialogID, ResultsList, 2, w/2, w, DG_IS_LEFT, DG_IS_NOTRUNC, false, true);
//some test data
DGListInsertItem (dialogID, ResultsList, DG_LIST_BOTTOM);
DGListSetItemText (dialogID, ResultsList, DG_LIST_BOTTOM, "testppty\ttestvalue");
I saw another post that suggested that you have to set the header size, eg
(DGListSetHeaderItemSize(dialogID, ResultsList, 1, 100);
but that doesn't seem to have any effect on the problem.
How do I get the header text on the second column to appear?
DGListSetHeaderItemCount(dialogID, ResultsList, 2);
DGListSetHeaderFlags(dialogID, ResultsList, true, false, false);
DGListSetHeaderItemFlags(dialogID, ResultsList, 1, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 1, "Property");
DGListSetHeaderItemFlags(dialogID, ResultsList, 2, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 2, "Value");
//set up the columns
w = DGListGetItemWidth(dialogID, ResultsList);
DGListSetTabFieldCount (dialogID, ResultsList, 2); //two columns in the data
DGListSetTabFieldData(dialogID, ResultsList, 1, 0, w/2-1, DG_IS_LEFT, DG_IS_NOTRUNC, true, true);
DGListSetTabFieldData(dialogID, ResultsList, 2, w/2, w, DG_IS_LEFT, DG_IS_NOTRUNC, false, true);
//some test data
DGListInsertItem (dialogID, ResultsList, DG_LIST_BOTTOM);
DGListSetItemText (dialogID, ResultsList, DG_LIST_BOTTOM, "testppty\ttestvalue");
I saw another post that suggested that you have to set the header size, eg
(DGListSetHeaderItemSize(dialogID, ResultsList, 1, 100);
but that doesn't seem to have any effect on the problem.
How do I get the header text on the second column to appear?
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-04-22 01:02 PM
‎2013-04-22
01:02 PM
LesWoolsey wrote:Have you tried setting the number of columns first and then applying the header?
I'm trying to make a ListBox that shows multiple columns. I can get that much working but I can only seem to put a header on the first column.
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-04-22 05:15 PM
‎2013-04-22
05:15 PM
That fixed it thanks!