i just want to count all rows with checked checkbox, so my CellPressed Event looks like:
if column=0 then
for i as integer= 0 to me.LastRowIndex
if me.CellCheckBoxStateAt(i,0)=DesktopCheckBox.VisualStates.checked then
but its not working as expected, it only updates the value if clicked besides the checkbox…
its working when put into PaintCellBackground…
The checkbox state isn’t updated until after the CellPressed event so that count wont include the currently changing checkbox.
Ok i understand. But in which event do i have to put that Code to immediately update the count when the checkbox is clicked? Cellbackgroundpaint does work but does not seem to be the right place.
CellAction fires after the checkbox change so you can use that, just make sure you check what column was clicked if you have other editable columns in the listbox as this is the same event that fires when a cell edit is complete.