2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Dropdown list in gridBy default, the dropdown list is shown when the mouse is clicked on the dropdown button of the ComboBox cell. To show the dropdown list when any key is pressed in the ComboBox cell, the CurrentCell.ShowDropDown() method is used in the CurrentCellKeyPress event. C# this.gridControl1.CurrentCellKeyPress += new KeyPressEventHandler(gridControl1_CurrentCellKeyPress); void gridControl1_CurrentCellKeyPress(object sender, KeyPressEventArgs e) { //Checks whether the cell type is ComboBox or not. if (this.gridControl1[this.gridControl1.CurrentCellInfo.RowIndex, this.gridControl1.CurrentCellInfo.ColIndex].CellType == GridCellTypeName.ComboBox) { //Enables the show dropdown in the current cell. this.gridControl1.CurrentCell.ShowDropDown(); } }
VB Private Me.gridControl1.CurrentCellKeyPress += New KeyPressEventHandler(AddressOf gridControl1_CurrentCellKeyPress) Private Sub gridControl1_CurrentCellKeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) 'Checks whether the cell type is ComboBox or not. If Me.gridControl1(Me.gridControl1.CurrentCellInfo.RowIndex, Me.gridControl1.CurrentCellInfo.ColIndex).CellType Is GridCellTypeName.ComboBox Then 'Enables the show dropdown in the current cell. Me.gridControl1.CurrentCell.ShowDropDown() End If End Sub
After applying the properties, the Grid looks like the following screenshot. Note: Only the dropdown list values should be entered, otherwise, the dropdown is not shown.
Samples: C#: Dropdown VB: Dropdown |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.