Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox in a grid
Message
 
To
03/01/2012 04:47:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01529523
Message ID:
01532437
Views:
28
Okay, I beleieve I have fixed it. All the time my code was performing exactly wha I had asked of it. The issue was, the cusror was not updated when the accumulation method queried it. I soleved the problem with one statement in the click event of the checkbox:

The checkbox is bound to the field "Selected" in the cursor that populates the grid.
When I unbound the checkbox, I found it would maintain its last state when refreshing the grid with a new cursor. IOW, when repopulating the grid with new values, if from the previous cursor the check box was 'clicked', then all the new checkboxes would also be clicked.
Re-binding the control seems to eleveate that issue.

In the Click method of the checkbox:
* click

LOCAL lcInvoiceNumber, llSelected

WITH THIS

m.llSelected = .VALUE
m.lcInvoiceNumber = csrGLAR.INumber

UPDATE csrGLAR ;
SET ISelected = IIF(llSelected, .T., .F.) ;
WHERE INumber = lcInvoiceNumber

ENDWITH

RETURN

Then, as you suggested, I perform the accumulation routine from the valid event of the check box.

It seems to work exactly as I desire.

Well, okay. One command and a few supporting statements.

Thank you for your concise advise,

Gary De Lecce
Driving toward a Tactical Edge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform