Home Forums WinForms controls Xceed Grid for WinForms Grid CheckBoxEditor Reply To: Grid CheckBoxEditor

User (Old forums)
Member
Post count: 23064

The problem is that you are not using the right editor. When using the CellEditorManager class, the underlying editor for a boolean column is the WinCheckBox editor, not a GridCheckBox editor. So in your ActivatingControl event handle, you need to make this change, and the CheckedChanged event should fire properly. Moreover, in the DeactivatingControl event handle, you must use RemoveHandler and not AddHandler.

Private Sub CellEditorManager_ActivatingControl(ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs)

Dim editor As Xceed.grid.Editors.GridCheckBox = CType(e.Control, Xceed.Grid.Editors.WinCheckBox)
AddHandler editor.CheckedChanged, AddressOf editor_CheckedChanged

End Sub

Private Sub CellEditorManager_DeactivatingControl(ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs)

Dim editor As Xceed.grid.Editors.GridCheckBox = CType(e.Control, Xceed.Grid.Editors.WinCheckBox)
RemoveHandler editor.CheckedChanged, AddressOf editor_CheckedChanged

End Sub

Private Sub editor_CheckedChanged(ByVal sender As System.Object, ByVal e As EventArgs)

MsgBox(“checked”)

End Sub

Imported from legacy forums. Posted by André (had 361 views)