Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP team welcomes feedback and discussions on Sedna
Message
 
À
07/06/2005 16:19:34
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Divers
Thread ID:
01020020
Message ID:
01021134
Vues:
22
Hi

My solution is as follows:

I add two methods to my standard form.
Procedure SetListText
   Lparameters toThis
   If Lower(toThis.Class)="g"
      Return toThis.SetListText()
   Else
      Return toThis.Parent.Parent.SetListText()
   EndIf
endProc

Procedure SetListPicture
   Lparameters toThis
   toThis.SetListPicture()
   Return toThis.Column1.BackColor
EndProc

Then I add the following two methods to my grid:

Procedure SetListPicture
   This.Column1.imgStd1.Picture=...
EndProc
Procedure SetListText
   ...
   Return mytext
EndProc

Then I simply set:
ControlSource=ThisForm.SetTextList(This) or 
DynamicBackColor=ThisForm.SetListPicture(This)
Now I can keep the custom code with the actual grid control and I do not have to modify the form class for each different screen.

I will test this further because it works currently but I do remember several bugs in previous versions that basically made this solution unreliable.

So if all goes well I will have to retract my comments about the short comings of the grid in these situations.

Thanks,
Simon



>Hi Simon,
>
>> Yes your solution does work but it requires method calls to the form. I am using containers as the basic presentation object which are added to generic forms at runtime. Therefore, I do not have the option to put the methods in the form. Therefore, I have to have some work around because there is no ThisGrid reference that will work in the ControlSource property so that the method call could be part of the grid itself and more self contained.
>
>Could you use BindEvent() to redirect calls to methods in your containers vs. form?
>
>Malcolm
Simon White
dCipher Computing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform