Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to add my grid class to form class gives error
Message
From
03/09/2006 10:47:24
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
02/09/2006 21:27:27
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01149616
Message ID:
01150592
Views:
15
Hi Erick

Thanks for trying to help. Did you do the steps I've described below. i.e. put the prg based grid/header class into a container class then try to put the container class into a form class?

I've since discovered that if I leave the grid's columncount at 0 then, at runtime, set it to what I need in the form's Init method, everything works. I just cannot set the columncount in the class designer (because then it somehow does not want to use the column and header classes from the prg and reverts back to the default one - Fontname Arial "Yuck", etc.).

Mike


>Hi Mike,
>
>I did a simple test here and works. I had problem (not the same problem that you have) only when in my column class ou header class (into .prg) I used "This." when I would like of to change a property. If you be using "This." try delete it.
>P.S.: In my case (problem) VFP said: "Unknown member THIS". Somehow, "This." isn't necessary.
>Good luck!
>
>
>
>>I have a grid class that uses the MemberClassLibrary and MemberClass properties. The MemberClassLibrary points to a prg where the column class is defined and it in turn relies on a HeaderClass that is also in the same prg.
>>
>>I then drop this grid class on to a container class and set the column count to 2. The two columns appear as expected (using my MemberClass) and their headers are using the HeaderClass (again as expected).
>>
>>Now when I try to drop this container onto a form class, I receive the following error:
>>
>>"Cannot add this object to a grid"
>>
>>My only options are OK and Help. The help says:
>>
>>"You have attempted to execute the Grid.AddObject method to add an object other than a column to the grid.
>>
>>You are trying to add an object to a column, rather than adding a column to the grid.
>>
>>To add an object to a column, use the Grid.Column syntax with the AddObject method."
>>
>>Any idea where I went wrong?
>>
>>Thanks for all replies,
>>Mike
>
Previous
Reply
Map
View

Click here to load this message in the networking platform