Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating grid on the fly, some of the columns aren't cor
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00325088
Message ID:
00325343
Views:
21
Whoah... that was freakish. All I needed to do is set the columncount to the number of colunms needed and then I could dispense with the addobject lines below. Works fine now.

>I am creating a grid to display the contents of a cursor. Only the first 5 columns of the grid have a proper caption and are bound to the cursor. If I look at the grid in the debugger, all the captions and controlsource are set correctly, but the grid does not display either the captions or data after the 5th column. Can anyone see the flaw in my technique?
>
>
>THIS.RECORDSOURCE = "cCovering"
>this.addobject('cName','column')
>this.cName.controlsource = "cCovering.name"
>this.cName.header1.caption= "Name"
>this.cName.width = 120
>
>this.addobject('cOrd','column')
>this.cName.controlsource = "cCovering.ord"
>this.cOrd.header1.caption= "Order"
>this.cOrd.width = 40
>
>* add on and configure all day columns
>FOR nColumn = 3 to (lnDays + 2)
>	cColumn = alltrim(str(nColumn - 2))
>	this.addobject('cDay'+cColumn,'column')
>	this.columns(nColumn).header1.caption = cColumn
>	this.columns(nColumn).width = 70
>	this.columns(nColumn).controlsource = 'cCovering.Day'+cColumn
>ENDFOR
>
>THIS.refresh  && refresh the grid
>
Previous
Reply
Map
View

Click here to load this message in the networking platform