Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gridfooter.vcx
Message
From
14/12/2006 08:57:44
 
 
To
14/12/2006 08:36:42
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01177317
Message ID:
01177565
Views:
17
Dorin,

Once I changed that code described below, I am able to drop the control on the form at design time and everything works properly (there was another change necessary in the calculation of the grid height in AttachtoGrid if Not .lIsAttached where I set the height to the max() of your calculations or 24, but that is probably not the best solution).

So it looks like you need to handle the different font sizes and also programmatic creation of the gridfooter.

But thanks very much as I really like this control.

>I've come across another possible problem:
>
>when my grid initialises, there are no records to display, so aTotals[i] ends up as NULL. This causes a problem when CalcTotal() is called. This line gives an error:
>
>this.Columns(j).ControlSource = [(]+Transform(aTotals[i])+[)]
>
>The data source for this object must be a variable reference.
>
>I changed the code to this:
>
>
>			this.Columns(j).ControlSource = [(]+Transform(NVL(aTotals[i],0))+[)]
>			this.Columns(j).Controls(2).ControlSource = [(]+Transform(NVL(aTotals[i],0))+[)]
>
>
>
>in the calctotal, which means it works, but the columns in the grid footer are not tied properly to the the ones in my grid.
>
>Anything else I need to do?
>
>>>I've got another question:
>>>
>>>My grids are not configured with their controlsources at design time. I have a method on the grid that is called SetColumnControlSources where I do this in code. This method is called from the grid's Init().
>>>
>>>Initially I dropped the gridfooter on the form and set the various properties, but got an error that the controlsource for one of the columns I selected was blank. So I added this code in my grid's SetColumnControlSources:
>>>
>>>
>>>WITH this.Parent
>>>	.AddObject('oGridFooter', 'gridfooter')
>>>	.oGridFooter.Top = this.bottom + 1
>>>	.oGridFooter.left = this.Left
>>>	.oGridfooter.width = this.width
>>>	.oGridFooter.cColWithLabel = "column1"
>>>	.oGridFooter.cSourceGrid = "grdResidenceDetails"
>>>	.oGridFooter.cSumColumns = "column6,column7"
>>>	.oGridFooter.cTotalLabelExpression = 'TOTAL: ' + transform(reccount("c_ResidenceDetails")) + ' recs'
>>>	.oGridFooter.Visible = .T.
>>>ENDWITH
>>>
>>>
>>>this ends up with the footer displayed below the grid, but it's not showing the stuff I told it to (i'm not quite sure what data it's showing).
>>>
>>>How would I go about adding this class programmatically?
>>
>>You only need to leave .cSourceGrid empty ( it won't try to attach then ) and call gridfooter.attachToGrid( thisform.grdResidenceDetail ) after making your changes. It will adjust accordingly
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform