How to show ComboBox dropdown on entering text in WinForms GridGroupingControl?
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
AddHandler 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
Samples:
Conclusion
I hope you enjoyed learning
how to show the combobox dropdown when entering text in a cell in
GridGroupingControl.
You can refer to our WinForms GridGroupingControl feature tour page to know about its other groundbreaking feature representations and WinForms GridGroupingControl documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our 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 other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!