Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Grid Question
Message
 
 
À
21/06/2001 23:43:31
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00521780
Message ID:
00522318
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

I modified your code:
TempDBF="C:\TEMP\TEMP.DBF"

thisform.GridRefreshing = .T.

close tables
copy file (SourceDBF) to (TempDBF)
use (TempDBF) again alias "MyAlias"

with thisform.MyGrid
  .RecordSource = "MyAlias" && should be alias, not the PathName of the DBF file
&& I want the 4 columns to show field 1,3,5,7 of the table:
  .column1.controlsource="MyAlias.Field1" && "alias.field", otherwise grid will be lost as soon as current alias changes
  .column2.controlsource="MyAlias.Field3"
  .column3.controlsource="MyAlias.Field5"
  .column4.controlsource="MyAlias.Field7"
endwith

thisform.Refresh
DOEVENTS
thisform.GridRefreshing = .F.
thisform.Refresh && one more refresh
thisform.MyGrid.SetFocus
>Hi Vlad,
>
>Thanks a lot for the information, now I can prevent the grid from reconstructing and the layout is just exactly what I want.
>
>I wish I'm not asking too much but I still have problem now :\
>
>After using the new method, the grid can only show the first record of the table, not only this, if the table has 10 records, the grid would also have 10 rows each showing the first record of the table.
>
>my code to trigger the Grid update is:
>
>TempDBF="C:\TEMP\TEMP.DBF"
>
>thisform.GridRefreshing = .T.
>
>close tables
>copy file "&SourceDBF" to "&TempDBF"
>use &TempDBF
>
>with thisform.MyGrid
>  .RecordSource = "&TempDBF"
>  && I want the 4 columns to show field 1,3,5,7 of the table:
>  .column1.controlsource="Field1"
>  .column2.controlsource="Field3"
>  .column3.controlsource="Field5"
>  .column4.controlsource="Field7"
>endwith
>
>thisform.Refresh
>DOEVENTS
>thisform.GridRefreshing = .F.
>
>
>At design time, the init value of RecordSourceType of the grid is "table", RecordSource is "TEMP". Also for each column I have set the init value of controlSource as above.
>
>Thanks a lot for your attention and any help would be greatly appreciated!
>
>Jimi
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform