Hi Larry & David,
I got rid of that problem by placing the table opening code in the calling form.
However I now have a different problem: The cells which are based on a custom class based on the textbox class blank out when selected.
The reason for programatically setting up the columns was to be able to use this class and attach Right-click/Validation to the cells.
The custom class is, at this time, a textbox with its max width set to 4.
This.grdPatCells.ColumnCount= fcount('PATFILE')
This.grdPatCells.FontBold=.F.
This.grdPatCells.FontName='FIXEDSYS'
This.grdPatCells.FontSize=6
for x=1 to This.grdPatCells.ColumnCount
oPatCol='This.grdPatCells.Column'+allt(str(x))
&oPatCol..Width=40
&oPatCol..Header1.Caption=field(x)
&oPatCol..AddObject("txtDuty"+allt(str(x)),"PatCell")
&oPatCol..CurrentControl="txtDuty"+allt(str(x))
&oPatCol..RemoveObject("Text1")
&oPatCol..ControlSource=field(x)
next
Thanks for your responses, any suggestions would be appreciated.
>>Help!
>>I am having problems designing a grid whose Column Count/ControlSource I programatically set in the Init of the form within a for/next loop for the number of fields.
>>All seems to work except all the rows have the same values as the first record. The number of rows is correct for the record count.
>>TIA
>It would help if you showed how you are coding it...
>//:^)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement