Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Refresh Problem 1

Status
Not open for further replies.

crewchiefpro5

Programmer
Dec 17, 2004
33
0
0
US
I have a grid that changes the sort order by clicking on the column header. All of a sudden it does not refresh properly. The grid goes blank except the lines and columns are there, just no data. There is data in the dbf, and I checked it with the BROWSE command. Weird thing is This ONLY HAPPENS when I take out a BROWSE command just after I reload the controlsource data.

Here is the code for the SORTORDER method
*** variables defined are:
*** lcsortalt="Density"
*** lcfilter="combonum = 23

*** lcsortorder is a parameter passed by the column header *** to this function, for example
*** lcsortorder="SixtyFoot"
***
*** lcUpDown is reset, first it is Desc then Asce
*** lcUpDown="Desc"

SELECT run_date, run_number, reaction, ;
sixtyfoot, IIF(QUARTER > 0,QUARTER,sixsixtyft) AS QUARTER, ;
IIF(quartermph > 0,quartermph,mph660ft) AS quartermph, ;
tstop1,temp,humidity, barometric, ;
&lcsortalt ;
FROM race ;
&lcfilter ;
ORDER BY &lcsortorder &lcupdown , ;
run_number DESC ;
INTO ARRAY ANSARRAY

IF _TALLY > 0
SELECT csrrace
ZAP
APPEND FROM ARRAY ANSARRAY
GO TOP
**** grid works fine if I include a browse below
**** take the browse out and all the data is gone !
&& browse
ENDIF

I thought it worked fine before, what am I missing?

 
Grid reconstruction I would bet (makes the grid go all white and weird like that), though you should be able to zap the table and not run into that...

just set your grid's recordsource to nothing, do your operations on the datasource and then set your grid's recordsource back to what it was, such as...

Code:
thisform.grid1.recordsource = ""
Select * from race into cursor csrRace order by 1, 2, 3
go top in "csrRace"
thisform.grid1.recordsource = "csrRace"
thisform.grid1.refresh()

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top