Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet Another Grid Bug: Solution?
Message
 
À
09/05/1998 16:26:26
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00097448
Message ID:
00098459
Vues:
28
>>An elegant solution would have been nice, yes. ;).
>>
>>>I had the same _exact_ problem. I couldn't understand it at all because my grid class _used_ to work then one day I get that Expression not valid crap!
>>>
>>>I recreated the grid class and I copied all of the default code to the proper methods. I bet you wanted to here something a bit more eloquent yes? :)
>
>The eloquent (or elegant, or vice versa :) solution would be if the grid didn't reference itself as This. For your case
>
>ThisForm.TheGrid.setall("DynamicBackColor","IIF(RECNO()=ThisForm.TheGrid.nRecNo,RGB(0,255,255),ThisForm.TheGrid.BackColor)","column")
>
>...but the drawback is that this will work for all the grids named exactly TheGrid, and for no others. Another solution would be to have something like
>
>this.setall("DynamicBackColor","IIF(RECNO()=this.nRecNo,RGB(0,255,255),this.BackColor)","column")
>grid::refresh()
>nodefault
>
>in your grid.refresh event code, so this expression will be interpreted ( eval()ed, IMO) from within the grid code (and not from the form code) so expression containing "This.whatever" would evaluate to grid.whatever and not to form.whatever.

Thanks! I'm giving this bit of code a try now.

Michael G. Emmons
memmons@nc.rr.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform