Right. Clicking a CheckBox doesn't automatically select the row, but if you want it to, just add code like this in CellAction:

If me.CellCheck(row, 0) then // if checkbox on then select row
    me.ListIndex = row
Else
    me.ListIndex = -1
End

And in Change put:

  If me.ListIndex <> -1 then  // if a row selected, check the box also
    me.CellCheck(me.ListIndex, 0) = true
  Else  // no row selected, turn off checkboxes
    dim i as integer
    For i = 0 to me.ListCount - 1
      me.CellCheck(i, 0) = false
    Next
  End


You will need to use the appropriate row, column values. I assumed Column 0 for the checkboxes.

When you refer to "the code" I don't know what you want the code to respond to. But if you tie the CheckBox to row selection as above, your code can go in the Change event.

Best regards,

Jack



On Oct 14, 2006, at 3:11 AM, Bart Pietercil wrote:

Hi List,

In a listbox I have defined a column of typeCheckBox
Whenever the user clicks on the checkbox, the checkbox.value is set but the listbox.change event is not triggered. I could put the code in the cellAction event but then the code is not triggered when the user clicks in another cell of the same row (which does trigger the listbox.change event). Now it looks like this is meant to be since the listindex is not changed when i click on the checkbox column.

I could put the code in both, but that doesn't feel good, so if anyone feels inclined to shed some light on this


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to