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#
// form() // 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
‘Form() ' 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
Screenshot
Samples:
C#: ComboBox_CS
VB: ComboBox_VB
Conclusion
I hope you enjoyed learning about how to add ComboBox for particular column in WinForms GridGroupingControl.
You can refer to our WinForms Grid Control’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms Grid Control documentation to understand how to present and manipulate data.
For current customers, you can check out our WinForms 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 Grid Control 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!