>Grid.Refresh is not the best place for this operation, because it can fire internally sometimes. I think that separate custom method e.g. Thisform.RestoreGrid would work safer.
Actually I did that before, and it gave me the same result.
I put the code in Grid.Refresh before I gave up and scream for help :)
>Also, I don't quite understand: seemingly you run cross-tab query and at the same time you have columncount=3 (or you reset it on fly?).
That just for example, Edward.
Actually I build a 2 field table and a 2 column grid, the cross tab fired from a listbox.
and it look like this :
Grid1.ProgrammaticChange
Parameter cSelect,cOrder
Do Case
Case cSelect=1
Select * From myTable1 WHERE UPPER(ALLT(orderno))==UPPER(ALLT(cOrderno)) Into myTempCursor
Case cSelect=2
Select * From myTable2 WHERE UPPER(ALLT(orderno))==UPPER(ALLT(cOrderno)) Into myTempCursor
Endcase
DO vfpxtab WITH 'mytable'
This.Refresh()
Senna Dwipayana
Being good is better
Being better is a bless