How to add ComboBox for particular column in WinForms GridGroupingControl?
Add combobox for particular column
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.
this.gridGroupingControl1.TableDescriptor.Columns["CategoryID"].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.
this.gridGroupingControl1.TableDescriptor.Columns["Description"].Appearance.AnyRecordFieldCell.
ChoiceList = list;
VB
' Specify the Column name to add the combo box.
Me.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.
Me.gridGroupingControl1.TableDescriptor.Columns("Description").Appearance. AnyRecordFieldCell.ChoiceList = list
The screenshot below shows the combobox column.
Samples:
C#: ComboBox_CS
VB: ComboBox_VB
Conclusion
I hope you enjoyed learning about how to add a ComboBox for particular column in WinForms GridGroupingControl.
You can refer to our WinForms GridGroupingControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridGroupingControl documentation to understand how to present and manipulate data.
For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridGroupingControl and other WinForms components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!