I have a combo box with a data source which is a database table with many columns. I would like to group the drop-down rows by one of these columns, as can be done in the Grid control. The user needs to be able to expand/contract the groups. I gather the drop-down in a WinCombobox is actually a grid, so how do I go about this? Can I set it up at design time, or does it have to be done in the code?
Imported from legacy forums. Posted by Steve (had 2781 views)
Actually, I have found a way by chipping away at it myself. I did the following in the Load event on the form containing the combo:
grp = New Xceed.Grid.Group(“Group”) grpm = grp.HeaderRows(0) grpm.TitleFormat = “%GroupTitle% – %DataRowCount% Set(s)” grp.Collapse() ‘ not required, but how I wanted it to start off combo.DropDownControl.GroupTemplates.Add(grp)
This seems to work OK. The combo’s dropdown shows the group headers only, and each can be expanded/collapsed as required. Is it the “right” way to do this?
Imported from legacy forums. Posted by Steve (had 239 views)