Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summing values in a Grid Column
Message
From
07/01/2005 22:52:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00975355
Message ID:
00975357
Views:
10
>Hi,
>
>I've got a grid with a list of payments received from a customer. I'd like to display a total of all payments for the current customer into a readonly textbox.
>
>Is there an easy way of doing this?

Not precisely trivial, but yes, you can add up the values - several methods for that - and put the result in the TextBox. The tricky part is to keep the TextBox alligned with the corresponding Grid Column, because the user can (a) scroll off, (b) rearrange the column order, and (c) change the column widths.

You have to intercept each of the corresponding events, and change the .Left value of your TextBox. The calculation to make it allign with the correct Column is, surprisingly, the easiest part: just use the ObjToClient() function to get the offset from the left side of the Form.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform