Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why is a grid added to a form automatically bound to a t
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00364907
Message ID:
00364950
Vues:
21
John,
Fred was absolutely right. You can also use the column ControlSource properties to assign the correct field to each column (otherwise it will default to the column order of the table or cursor).

You might want to use the form designer to open a new form, add a grid (default VFP6) and play around a bit with assigning column and header information. Doing it programmatically will be easier when you've seen the results of changes in the designer.

HTH
Barbara

>How does a grid when .Add-ed to a form get bound automatically to an open table? Here's my code
>
>CLOSE ALL  && Close tables and databases
>OPEN DATABASE (HOME(2) + 'Data\testdata')
>USE customer IN 0
>frmMyForm = CREATEOBJECT('Form')
>WITH frmMyForm
>	.AddObject('grdGrid1','Grid')  && me:  bound
>		.grdGrid1.Left = 25
>		.grdGrid1.Visible = .T.
>	.AddObject('cmdCommand1','cmdMyCmdBtn')
>		.cmdCommand1.Left = 125
>		.cmdCommand1.Top = 210
>		.cmdCommand1.Visible =.T.
>	.AddObject("txtText1",'Textbox')  && me: not bound
>		.txtText1.Left = 125
>		.txtText1.Top = 240
>		.txtText1.Visible = .T.
>	.Closable = .F.  && Disable the window pop-up menu
>	.SHOW
>ENDWITH
>READ EVENTS
>
>DEFINE CLASS cmdMyCmdBtn AS CommandButton
>	Caption = '\<Quit'
>	Cancel = .T.
>	Height = 25  && me: withour this property it's reeeal small
>	PROCEDURE Click
>		CLEAR EVENTS
>		CLOSE ALL
>ENDDEFINE
>
>
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform