Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing values in a Grid Column
Message
De
07/01/2005 22:52:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00975355
Message ID:
00975357
Vues:
11
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform