How to show combobox dropdown on entering textin WinForms Grid?
Combobox customization
To show the ComboBox dropdown on entering the text in cell, TableControlCurrentCellKeyPress event can be used and CurrentCell.ShowDropDown property can be used in that event. The Autocomplete option can be enabled by using AutoCompleteInEditMode property.
C#
//Assigning the column cell types as GridListControl this.gridGroupingControl1.TableDescriptor.Columns["Description"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.GridListControl; //Enables Autocomplete this.gridGroupingControl1.TableDescriptor.Columns["Description"].Appearance.AnyRecordFieldCell.AutoCompleteInEditMode = GridComboSelectionOptions.AutoSuggest; //Triggering Event this.gridGroupingControl1.TableControlCurrentCellKeyPress += gridGroupingControl1_TableControlCurrentCellKeyPress; //Handling Event void gridGroupingControl1_TableControlCurrentCellKeyPress(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyPressEventArgs e) { if (!e.TableControl.CurrentCell.IsDroppedDown) { e.TableControl.CurrentCell.ShowDropDown(); } }
VB
'Assigning the column cell types as GridListControl. Private Me.gridGroupingControl1.TableDescriptor.Columns("Description").Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.GridListControl 'Enables Autocomplete Private Me.gridGroupingControl1.TableDescriptor.Columns("Description").Appearance.AnyRecordFieldCell.AutoCompleteInEditMode = GridComboSelectionOptions.AutoSuggest 'Triggering Event Private Me.gridGroupingControl1.TableControlCurrentCellKeyPress += AddressOf gridGroupingControl1_TableControlCurrentCellKeyPress 'Handling Event Private Sub gridGroupingControl1_TableControlCurrentCellKeyPress(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyPressEventArgs) If Not e.TableControl.CurrentCell.IsDroppedDown Then e.TableControl.CurrentCell.ShowDropDown() End If End Sub
Screenshot
Samples:
Conclusion
I hope you enjoyed learning on how to show the combobox dropdown on entering a text in cell in WinForms GridGroupingControl.
You can refer to our WinForms Grid feature tour page to know about its other groundbreaking feature representations. You can also explore our 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 ASP.NET MVC Chart and other ASP.NET MVC 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!