Home › Forums › WinForms controls › Xceed Grid for WinForms › Grid CheckBoxEditor › Reply To: Grid CheckBoxEditor
Thanks I made it work this way, but i am not still where i intended to be.
1. this way if a user check the checkbox and do nothing after that i cant change the database value. So i need thecheckbox checked event or checkedchanged.
so i tried this one and in following way:
grid1.begininit
…
grid1.Columns.Add(New Column(“name1”, GetType(Boolean)))
grid1.Columns(8).Width = 60
‘Then i suscribe to the editor activating and deactivating events for particular column (or i think i do that)
AddHandler grid1.Columns(8).CellEditorManager.ActivatingControl, AddressOf CellEditorManager_ActivatingControl
AddHandler grid1.Columns(8).CellEditorManager.DeactivatingControl, AddressOf CellEditorManager_DeactivatingControl
then i handle the editor activation and deactivation and add new handler to handle that event
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.GridCheckBox)
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.GridCheckBox)
AddHandler editor.CheckedChanged, AddressOf editor_CheckedChanged
End Sub
Private Sub editor_CheckedChanged(ByVal sender As System.Object, ByVal e As EventArgs)
MsgBox(“checked”)
End Sub
But nothing happens, i figure i havent attached the handlers for the events properly, but i wonder how to achieve that for lets say particular column or for every checkbox created in grid.
I would later on in procedure that handles checkedchanged event determine which cell and what changes to make to dbase, but i am lacking the ability to capture the checkbox changed event
thanks in advance the last reply was good help and it took me in right direction
Imported from legacy forums. Posted by Ma (had 515 views)