Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating Grid with n-columns and n-methods
Message
 
To
29/01/2006 09:20:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01091251
Message ID:
01091405
Views:
11
Zlatko,

What you want to do is create a Column class that has your procedure code defined in it. Then, create your Grid class with code in its Init that does something like this:
FOR i = 1 TO this.ColumnCount
  this.AddObject('Column' + TRANSFORM(i), 'yourColumnClass')
  STORE .t. TO ('this.Column' + TRANSFORM(i) + '.Visible')
ENDFOR
Something along those lines should get you going.

HTH,
Chad

>I'd like to create a grid programatically and it works fine with
>
>DEFINE CLASS ...
> add object ...
>
> procedure ...

>
>statements. But when I try to put a FOR...ENDFOR loop for adding more objects, it doesn't work because this statement is not allowed in a class definiton.
>
>So, how can I easily create a grid with n-columns and n-procedures (click, right-cklick events...) at run-time?
>
>
>Thank's, Zlatko.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform