Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Requery a grid
Message
 
 
À
15/05/2015 14:20:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01518718
Message ID:
01619884
Vues:
53
>>>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

I don't understand your question. If your curGrid may change columns and you want all of them to be displayed in a grid, then you would not be able to use safe select approach unless you want to have a cursor with all possible number of columns first and only display columns conditionally. In other words, you can have a curGrid with, say, 20 columns and grid setup with 20 columns bound to that cursor. In run-time when you re-select your rows, if you don't want some columns, you make them invisible in a grid.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform