>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