Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Requery a grid
Message
From
15/05/2015 14:20:11
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01518718
Message ID:
01619882
Views:
186
>>Hi All:
>>
>>How do I requery a grid? In other words, my rowsource is SQL with a WHERE clause, so every time the condition changes I want to requery. There is no requery on a grid.
>>
>>Refresh doesn't seem to do the job.
>>
>>Yossi
>
>The best solution will be in using safe select approach.
>
>See http://weblogs.foxite.com/andykramek/archive/2005/03/19/174.aspx

Hi Naomi,

I referred to an answer you gave me a few years ago.

My problem is I'm not changing the WHERE; I'm changing the columns. I still want to stay with safe select, however, since I might want to add fuctionality to modify the WHERE as well.

This is the code I'm trying to run in the CLICK of an option group:
DO CASE
CASE THIS.option1.VALUE = 1
	lcCustomerColumns = GenerateColumns('')
CASE THIS.option2.VALUE = 1
	lcCustomerColumns = GenerateColumns('FAIR')
ENDCASE

lcSql = "SELECT curStock.desc, " + lcCustomerColumns + " FROM curStock"
THISFORM.safeselect(lcSql, "curGrid")
thisform.gridrefresh()
The problem is that the cursor that the grid is bound to (curGrid) doesn't change its columns.

Thanks

Yossi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform