Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.67 KB

File metadata and controls

43 lines (33 loc) · 1.67 KB

How to add ComboBox for particular column in WinForms GridGroupingControl?

In order to have a combo box in a specified column in WinForms GridGroupingControl, the required column name should be assigned the cell type as ComboBox. This can be done by changing the column’s Appearance through the TableDescriptor property.

C#

// Specify the Column name to add the combo box.
gridGroupingControl1.TableDescriptor.Columns["Description"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox;

StringCollection list = new StringCollection();
list.Add("Quartz");
list.Add("Ruby");
list.Add("Saphire");
list.Add("Emerald");
list.Add("Diamond");
list.Add("Graphite");

// Specify the required list to be displayed in the drop down.
gridGroupingControl1.TableDescriptor.Columns["Description"].Appearance.AnyRecordFieldCell.ChoiceList = list;

VB

' Specify the Column name to add the combo box.
gridGroupingControl1.TableDescriptor.Columns("Description").Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox

Dim list As New StringCollection()
list.Add("Quartz")
list.Add("Ruby")
list.Add("Saphire")
list.Add("Emerald")
list.Add("Diamond")
list.Add("Graphite")

' Specify the required list to be displayed in the drop down.
gridGroupingControl1.TableDescriptor.Columns("Description").Appearance.AnyRecordFieldCell.ChoiceList = list

The screenshot below shows the combobox column.

ComboBox for particular column

View sample in GitHub