Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid columncount goes to zero!
Message
De
07/09/2011 13:27:06
 
 
À
07/09/2011 13:11:09
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:
01522921
Vues:
45
>>>>>>
>>>>>>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
>>>>>
>>>>>To clear the controlsource is exactly the way NOT to do it!!!!!! Read my code to see how you avoid it.
>>>>
>>>>Yes, I already read your codes, but that is your "safe select" method, not mine.
>>>>If you read last line of my reply, then you should see I always use index for this purpose, so I never use "safe select" method
>>>>or emptying grid.controlsource on runtime.
>>>>
>>>>
>>>>Regards,
>>>>Onytoo
>>>
>>>By setting conrolsource to blank and then back to the new cursor, you lose all formatting, dynamicxx stuff, and most other settings which are tied to the columns. By using Safe Select you get the best of two worlds. And by the way, I always create the index tags I may need in the lines after I create the empty "gridmaster" cursor.
>>
>>
>>Hmmm... In the past, when I still use this method (emptying grid controlsource), I never face that problem (loosing any setting of columns).
>>Except you manually reset grid.columncount property.
>>CMIIW.
>>
>>
>>Regards,
>>Onytoo
>
>If it works for you, no reason to change. Personally I had many problems in the past, but not after I changed my code to always use "safe selects".

But thank you for remind me sir, maybe in the future I will consider to use "safe select" method for my own good.


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

Click here to load this message in the networking platform