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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid problem

Status
Not open for further replies.

engan

Programmer
Jul 15, 2001
53
ID
hi, i have a problem with my grid, I try to populate my grid with select statement then I put another select statement in interactivechange of combobox to refresh the new data with different filter. What I got is my grid definition seems to be changed by visual foxpro ie. my column width is reset, my hilite row is reset as well.

on init event
SELECT col1,col2 from table1 into cursor mygrid.name
mygrid.recordsource = ALIAS()

on interactivechange
SELECT col1,col2 from table1 where col1.code = "AA" into cursor mygrid.name
mygrid.recordsource = ALIAS()
mygrid.refresh

the first select is ok, the second select resets my grid definition.

any ideas ?
 
Hi!

It is known as Grid Reconstruction Behaviour. There is also Automatic re-binding of column contol sources that seems you did not met yet because columns match the phisical structure of the result cursor. Take a look to the FAQ article about Grid reconstruction at the I re-post it here too, so check it here.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Here's how I would do it:
Code:
on init event
SELECT col1,col2 from table1 into cursor mygrid.name
mygrid.recordsource = ALIAS()

on interactivechange 
[b]mygrid.recordsource=''[/b]
SELECT col1,col2 from table1 where col1.code = "AA" into cursor mygrid.name
mygrid.recordsource = ALIAS()
mygrid.refresh
 
Heh...my guess about how to boldface a segment was wrong. The
Code:
[b]
and
Code:
[/b]
tags should be ignored, as I thought they were supposed to put that line in BOLDFACE. Unfortunately, it looks like the tags don't nest. :eek:(
 
My grid works fine now, Thanks for your tips chpicker & Tomasdill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top