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

User (Old forums)
Post count: 23064

I have a similar situation. I need to enable/disable editing of other cells in a row based on the checked value of the 1st column of the grid. The grid is being built in code. We’re using the winform grid 3.8. Here’s the relevant code:

Dim chkBox As New Xceed.Editors.WinCheckBox

Dim col1ChkBoxEditor As New Xceed.Grid.Editors.CheckBoxEditor(chkBox)

Dim col1ChkBoxViewer As New Xceed.Grid.Viewers.CheckBoxViewer(chkBox)

grid1.SingleClickEdit = True

With .Cells(“column1”)

.Value = False

.CellEditorManager = diagChkBoxEditor

.CellViewerManager = diagChkBoxViewer

End With

AddHandler .Cells(“column1”).Click, AddressOf grid_FirstColumnClicked 


The problem I’m having is the click event doesn’t fire every time. If the 1st column has focus, I get the click events. If it doesn’t, the user has to click twice to get the event to fire (on the second click). The visible state of the box does change though (i.e. the 1st click checks the box, the second unchecks it and I get the click event). I tried adding a handler to  the .Cells(“column1”).ValueChanged and it never did fire. 

What changes do I need to make to get the click to fire every time or what event should I be using?

Imported from legacy forums. Posted by James (had 277 views)