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: