We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CellType Problem

I am using the following code in my GDBG so that if the user is on a cell which is a combobox and hits the enter key the combobox will drop down: Private Sub m_grid_CurrentCellKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles m_Grid.CurrentCellKeyDown Dim Row As Integer = m_Grid.CurrentCell.RowIndex Dim Col As Integer = m_Grid.CurrentCell.ColIndex If e.KeyValue = Keys.Enter then If m_Grid(Row, Col).CellType = "ComboBox" Then If Not m_Grid.CurrentCell.IsDroppedDown Then m_Grid.CurrentCell.ShowDropDown() e.Handled = True End If End If end if End Sub Depending on certain conditions however, some of the cells in my grid which were initially set as "ComboBox" cells are being reset to "Static" in the PrepareViewStyleInfo method (e.Style.CellType = "Static"). This is properly keeping the combobox from dropping down when the mouse is clicked in these cells, however for some reason, if I type the enter key on the cell the above code still thinks the CellType is a ComboBox and attempts to show the drop down. This results in an error message "dropDownImp is Null". Any help on this would be appreciated. Thanks, Jeff

1 Reply

AD Administrator Syncfusion Team February 15, 2005 11:26 PM UTC

Try moving the code that sets the ComboBox celltype from your PrepareViewStyleInfo into a grid.Model.QueryCellInfo event handler to see if this will handle this problem.

Loader.
Live Chat Icon For mobile
Up arrow icon