Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Grid a possibility?
Message
From
24/11/1998 12:34:12
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00160820
Message ID:
00160992
Views:
20
Hi Pete ---

Yes, old footnote. It has sentimental value and applies very well to VFP development :-)

OK, try this (this is Grid Init Code still) -- requires FOXTOOLS.FLL if VFP5:
cWasDBC=DBC()
cDBCName=""
nDEOCount=AMEMBERS(aDEObjects,THISFORM.DataEnvironment,1)
FOR iCounter=1 TO nDEOCount
   IF aDEObjects(iCounter,2)="Object"
      WITH EVAL("THISFORM.DataEnvironment."+aDEObjects(iCounter,1))
         IF .BaseClass= "Cursor" AND .Alias = THIS.RecordSource
            cDBCName = .Database
            cDBCName = JUSTSTEM(cDBCName)
            EXIT
         ENDIF
      ENDWITH
   ENDIF
ENDFOR
IF !EMPTY(cDBCName
   OPEN DATABASE &cDBCName
   FOR i = 1 TO THIS.ColumnCount
      cFieldName=THIS.Columns(i).ControlSource
      THIS.Columns(i).Header1.Caption = DBGETPROP(cFieldName,"FIELD","Caption")
   ENDFOR
ENDIF
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform