Usually I populate the grid showed in the first form,
by determining the table and columns calling a method 
in the load event of the form.
I use pageframes so the grids on the next pages are assigned
tables when they are instantiated.
I do something like this for my lookout table;
cView = "sConsu"
cSQL= "SELECT Nome, UF, Codigo FROM Cidades "
cTables = 'Cidades'
cParList= ""    
laFields[1,1]= "Codigo"
laFields[1,2]= ""
laFields[1,3]= "I"
laFields[1,4]= .T.
laFields[1,5]= ""
laFields[1,6]= .F.
= CREATEOBJECT("CreateView",cSQL,cView,cTables,cParList,@laFields)  
*------
WITH thisform.PgfMain.bPage1.grdCursor 
  .RecordSource= "sConsu"
  .Column1.ControlSource= "sConsu.Nome"
  .Column2.ControlSource= "sConsu.UF"
ENDWITH 
SELECT sConsu 
INDEX ON Nome TAG Nome
INDEX ON UF TAG UF ADDITIVE
thisform.Requery(1)
=DODEFAULT()
WAIT CLEAR 

E.


>________________________________
> From: Gene Wirchenko <[email protected]>
>To: ProFox Email List <[email protected]> 
>Sent: Friday, September 13, 2013 2:15 PM
>Subject: Grids II
> 
>
>Dear Vixens and Reynards:
>
>     I thought I had forgotten a detail so I have reposted with it.
>
>     The missing detail: My forms are in code.
>
>     Having finished another bit of work, I am again trying to wrap myself 
>around grids.
>
>     I have taken the sample program in the VFP help.  How does it determine 
>what the data it will display is?  It seems to be defaulting to the entire 
>current table as soon as it is instantiated.
>
>     How do I control this to display arbitrary tables or cursors and only 
>some columns?
>
>     In case it makes any difference, I am using free tables only.
>
>Sincerely,
>
>Gene Wirchenko
>
>
>_______________________________________________
>Post Messages to: [email protected]
>Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
>OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
>Searchable Archive: http://leafe.com/archives/search/profox
>This message: http://leafe.com/archives/byMID/profox/
>** All postings, unless explicitly stated otherwise, are the opinions of the 
>author, and do not constitute legal or medical advice. This statement is added 
>to the messages for those lawyers who are too stupid to see the obvious.
>
>
>

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to