Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disappearing Grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00182897
Message ID:
00183105
Vues:
22
>>>I understand what you mean but the example shows that even column settings are not preserved. I believe you agree that the situation when columns get reverted, and even worse with the same e.g. text.click code behind, is not only bad but also highly confusing. It would be better in this case to lose everything.
>>
>>Column settings, except the column's controlsource, ARE retained. That's what he's saying. Right Erik? (PMFJIA).
>
>Rich, I have to retype now my initial reply which started all this:
>"After data source reopening you should also restore grid recordsource and column.controlsources:
> With Thisform.Grid
> .Recordsource="mytable"
> .Column1.Controlsource="mytable.myfield1"
> .Column2.Controlsource="mytable.myfield2"
> ***
> .Refresh
> Endwith"
>As you see, I suggested to reset exactly column controlsources. Regardless this evidency, I would also urge you to think what good in preserving everything except column controlsources? At best, someone doing this way will get some mess to clean up.

OK, I just misunderstood because "even column settings are not preserved" sounded to me like you meant all column settings. I saw your original reply.

To answer your question, I agree with you that retaining all properties "except these" is pretty useless, unless you have those specific properties stored somewhere (grid custom property?) because you know you'll need to restore them. And then, of course, the next version of FoxPro will retain those properties and you'll have a useless custom property and method code ... (remember the old Murhpy's Laws of Computers poster?)

This is why, as far as I can see, if I ever need to refresh a grid's record source I'll set things up in such a way that I can use Requery([source]) and Grid.Refresh rather than Grid.RowSource="", USE IN [source], USE [source], [reset everything that got lost because of Grid.RowSource=""]!

So far I've always based a grid on a view, usually parameterized, so that I can use parm="condition", Requery([view]), Grid.Refresh whenever the condition for including records in the grid should change. Works great. Hope I don't run across a situation I can't make it work!

Cheers,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform