Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to display total of a grid column?
Message
De
17/06/2010 06:38:38
 
 
À
17/06/2010 05:17:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01469381
Message ID:
01469389
Vues:
41
>>Hi,
>>
>>My grid has an "Amount" column which I want to display its total.
>>Currently, I use a readonly textbox to display that total right below the "Amount" column.
>>
>>My concern is when user adjust the grid, say change a column size, that means the "total amount" textbox must be moved so that it always aligned to the "Amount" column.
>>Am I right that I will have to calculate on-the-fly to find out the left pos of the "Amount" column every time? (I mean summing up the width of all columns before the "Amount" col)
>>
>>I was thinking it is possible to display the total amount as footer of the "Amount" column. Is it possible to also add a footer to a grid column (besides its header)? If so how do I add that footer?
>
>
> > "total amount" textbox
>> left pos of the "Amount" column every time? (I mean summing up the width of all columns before the "Amount" col)
>
>(1)
>The left and the width of the amount column can be determined using objToClient(ColumnObject, 2) and objToClient(ColumnObject, 3)
>Be aware that objToClient returns form coordinates - so you will need to get the objToClient() of the parent of the grid (form, page, container) and adjust the column's obtToClient to the coordinates of the parent of the grid
>
>(2)
>> when user adjust the grid, say change a column size
>
>
>You can use bindEvent ( with nFlags = 1: call delegate after event code ) to bind to
>- column.Moved event
>- column Resize event
>
>You may also have to bind to column.Visible
>
>To test is what happens when the grid is scrolled horizontally. Does that trigger the Moved event ? Also, the column may not be visible any more
>
>And if you start working with panels - that may be interesting since the column can appear twice !
>
>(3)
>> footer
>
>Nothing comes to mind

Thanks!
OBJTOCLIENT is a good function, I will bear that in mind!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform