thank you very much
YES, The trick is to never recreate the grid.
>The trick is to never recreate the grid.
>Select whatever into cursor curtemp
>select mycursor
>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