Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid columncount goes to zero!
Message
De
07/09/2011 07:10:56
 
 
À
06/09/2011 22:38:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01522860
Message ID:
01522875
Vues:
92
>Hi All:
>
>I constructed a grid on the fly with a columncount of 6 and set all the properties. Everything works. The recordsource is 'curbrowsemodal' and the recordsourcetype is 1.
>
>Now I want to give the user the ability to decide the sort order.
>
>As soon as I execute the following, the coulumnn =count goes to zero!
>
>
>IF thisform.opgSortDirection.option1.Value = 1   &&Ascending
>	SELECT * ;
>	FROM curBrowseModal ;
>	ORDER BY cSortSeqASC ASC ;
>	INTO CURSOR curBrowseModal
>ELSE
>	SELECT * ;
>	FROM curBrowseModal ;
>	ORDER BY cSortSeqDSC DESC ;
>	INTO CURSOR curBrowseModal
>ENDIF
>
>
>If I try to solve the problem by setting the recordsource to curBrowseModalS and executing the following, I get an empty grid!
>
>
>IF thisform.opgSortDirection.option1.Value = 1   &&Ascending
>	SELECT * ;
>	FROM curBrowseModal ;
>	ORDER BY cSortSeqASC ASC ;
>	INTO CURSOR curBrowseModalS
>ELSE
>	SELECT * ;
>	FROM curBrowseModal ;
>	ORDER BY cSortSeqDSC DESC ;
>	INTO CURSOR curBrowseModalS
>ENDIF
>
>
>And if I create the curBrowseModalS ahead of time, I get a zero columncount!
>
>
>
>
>Thanks,
>
>Yossi

Try to clear grid controlsource first and set it back on the end
thisform.Grid1.ControlSource = ""
IF thisform.opgSortDirection.option1.Value = 1   &&Ascending
	SELECT * ;
	FROM curBrowseModal ;
	ORDER BY cSortSeqASC ASC ;
	INTO CURSOR curBrowseModalS
ELSE
	SELECT * ;
	FROM curBrowseModal ;
	ORDER BY cSortSeqDSC DESC ;
	INTO CURSOR curBrowseModalS
ENDIF
thisform.Grid1.ControlSource = "curBrowseModalS"
thisform.Grid1.Refresh()
But I prefer to create and use an index and change the order on the fly


Regards,
Onytoo
Regards,
Ony
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform