Hi ,
still a bit of follow-up on the matter : -)
I needed to do this
Dim LastColumn As Integer
LastColumn = me.ColumnCount-1
if me.CellCheck(row,LastColumn) then
me.CellCheck(row,Column) = not(me.CellCheck(row,Column))
me.ListIndex = row
else
me.ListIndex = -1
end if
For this Change event code to do exactly what I needed
// show the description for a selected module
Dim ThisModuleID As Integer
Dim i As Integer
Dim aRec As Dictionary
Dim LastColumn As Integer
Dim counter As Integer
LastColumn = me.ColumnCount -1
Counter = 0
if me.ListIndex <> -1 Then
me.CellCheck(me.ListIndex,LastColumn) = not(me.CellCheck
(me.ListIndex,LastColumn))
For i = 0 to me.ListCount-1
if me.CellCheck(i,LastColumn) then
Counter = counter + 1
end if
next
if Counter > 0 then
cb_testInclusive.Enabled = True
cb_testInclusive.Value = True
else
cb_testInclusive.Enabled = False
cb_testInclusive.Value = False
end if
ThisModuleID = val(me.Cell(me.ListIndex,0))
For i = 0 to UBound(App.TheProject.Modules)
aRec = App.TheProject.Modules(i)
if aRec.Value("module_id") =ThisModuleID then
me.HelpTag = aRec.Value("module_desc")
exit
end if
next
else
me.HelpTag = "Klik op een module om deze te selecteren. Blijf
wijzen naar een geselecteerde module om de beschrijving ervan te tonen."
end if
This would indicate that the value changes in the checkboxcolumn
before the cellaction is fired.
So I needed to reverse this in the cellaction event, in order for the
change code to behave uniformly for a click on a data column or a
click on the checkboxcolumn.
Although things now work impacable is stil strange to me that the
cellaction event does not let me prevent the change from happening
( so I need to reverse what it automatically does )?
But as I said things work as I want them, so no rush
Bart
On 16-okt-06, at 11:20, Bart Pietercil wrote:
THX Jack,
That's what I needed.
Bart
On 14-okt-06, at 14:42, CV wrote:
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
_______________________________________________
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>
_______________________________________________
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>