Home Forums WinForms controls Xceed Grid for WinForms edit ComboBoxEditor Reply To: edit ComboBoxEditor

Xceed Support
Post count: 5658

Yes, it’s possible. Here, I did not handle all the possibilities (double values, validation, …). However, it should get you started.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
For j As Integer = 0 To 3
Dim col As Column = New Column(“Column” & j.ToString())
Next j

wcb = New WinComboBox(EnhancedBorderStyle.None)

For i As Integer = 0 To 19
Dim row As Xceed.Grid.DataRow = gridControl1.DataRows.AddNew()
For Each cell As Cell In row.Cells
cell.Value = “Item ” & i.ToString()
Next cell
wcb.Items.Add(“Item ” & i.ToString())
Next i

gridControl1.Columns(0).CellEditorManager = New ComboBoxEditor(wcb)
AddHandler gridControl1.Columns(0).CellEditorManager.DeactivatingControl, AddressOf CellEditorManager_DeactivatingControl
End Sub

Private wcb As WinComboBox

Private Sub CellEditorManager_DeactivatingControl(ByVal sender As Object, ByVal e As CellEditorEventArgs)
wcb.Items.Add((CType(e.Control, WinComboBox)).TextBoxArea.Text)
End Sub

Imported from legacy forums. Posted by CharlesB (had 266 views)