Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with grid refill
Message
From
15/01/2007 02:36:41
 
 
To
15/01/2007 00:24:53
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01185524
Message ID:
01185538
Views:
11
This message has been marked as the solution to the initial question of the thread.
The trick is to never recreate the grid.
Select whatever into cursor curtemp && a temp cursor
select mycursor && The cursor that drives your grid
zap
select from (dbf('curtemp'))
yourgrid.refresh()
>Hi all,
>I have a form with one Grid on it.
>When I move on Table1 records, I want to create a cursor ( MyCursor ) and fill it with some data from Table2.
>I put below code in MyRefillGrid method.
>
>In Init method :
>
>CrsTempSabt = "_" + SUBSTR(SYS(2015), 4)
>
>
>In MyRefillGrid method :
>
>
>CREATE CURSOR &MyCursor  (HCode C(14), HName C(100), HADesc C(50), Hnum1 N(12,0), Hnum2 N(12,0))
>
>
>* Filling MyCursor with Table2 data
>
>
>thisform.grid1.RecordSource = MyCursor
>thisform.grid1.column1.ControlSource = "HCode"
>thisform.grid1.column2.ControlSource = "HName"
>thisform.grid1.column3.ControlSource = "HADesc"
>
>SELECT &MyCursor
>GO TOP
>Thisform.grid1.Refresh
>
>
>It is ok for first time that I run my form, but when I move to another record in table1, and want to recreate MyCursor, all of grid columns destroyed ( column width and also its header title )
>What must I do? I dont want to create MyCursor once and delete all record in MyCursor each time. i want to have a clear cursor.
>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform