Archive for January, 2008

Jan 23 2008

Enable Text Editing in .NET DataGridViewComboBoxColumn

Published by turlach under Uncategorized

Here’s where the C# version came from: Devolutions.net

And here is the VB version:


   Private Sub dgvMacroGrid_EditingControlShowing(ByVal sender As Object,
            ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs)
            Handles dgvMacroGrid.EditingControlShowing
      'Enable text editing in combo cells
      If (dgvMacroGrid.CurrentCellAddress.X = colMacroLookup.DisplayIndex) Then
         Dim cb As ComboBox = CType(e.Control, ComboBox)
         If (cb IsNot Nothing) Then
            cb.DropDownStyle = ComboBoxStyle.DropDown
         End If
      End If
   End Sub

No responses yet