Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gridhighlighter Invalid dynamic forecolour - problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00770867
Message ID:
00771534
Vues:
11
>>Elmer may be right, if it happens on form closing. Maybe because of the changes in ZOrder of the form controls GHL gets destroyed before the grid. Then, when grid tries to evaluate the Dynamic... properties one last time, GHL is already not there and GHL.nRecno property (that Dynamic.. expression checks) also is gone already, which causes Invalid Dynamic expression... error.
>>
>>GHL itself has the code in Destroy method that checks for the grid existence and resets the Dynamic properties to nothing. But if the object destruction happens in the reverse order, the Dynamic expression may point to non-existent GHL control property.
>>
>
>If you have such code, then the whole situation doesn't make much sense. Only if we suspect partial descruction of GHL, then grid destruction, then finishing with GHL. Weird indeed. It would be good to have an easy reproducable scenario.

>Did you try to create a form, add GHL first, then the grid? Would you have this problem?

Yes, I tried that and the form and highlighting still work properly on form open/close.

The code in ghl.Destroy() is
*** GHL.Destroy()
lcHost = THIS.cHostname
* Make sure that grid still exists, as it might be destroyed already if ZOrder was changed later.
IF TYPE("THIS.PARENT.&lcHost.") = "O" AND !ISNULL(THIS.PARENT.&lcHost.) 
   WITH THIS.PARENT.&lcHost.
      .SETALL("DynamicBackColor", [''], "Column")
      .SETALL("DynamicForeColor", [''], "Column")
      .SETALL("DynamicFontBold", [''], "Column")
   ENDWITH
ENDIF
As you can see, if GHL is destroyed first, it supposed to reset Grid's Dynamic properties to empty state. The grid then should not error out on Dynamic properties unless there is something weird going on and Dynamic... properties retain their expressions somehow after GHL is destroyed.

Maybe it worth a try to recreate the grid control from scratch.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform