Page 1 of 1

GetProperty of grid in form

Posted: Mon Jul 10, 2017 4:11 pm
by serge_girard
Hello,

I have an application with several variables forms with a grid in it.

When I want to retrieve values from a grid I do:

Code: Select all

nATL := GetProperty( 'FORM_1' , 'Grid_1' , 'ItemCount' ) 
FOR A = 1 TO nATL
   x1    := Form_Pt1.Grid_1.Item (a) [1] 
   // do something with x1
NEXT
But when I have variable form names I want to use something like this:

Code: Select all

nATL := GetProperty( cFORM , 'Grid_1' , 'ItemCount' ) 
FOR A = 1 TO nATL
   x1    := GetProperty( cFORM , 'Grid_1' , 'Item(A)' [1] )    // nok
   x2    := &cFORM.Grid_1.Item(a) [1] 	 // nok
   // do something with x1
NEXT
I tried several combinations like GetProperty( cFORM , 'Grid_1' , 'Item(A,1' ) but I can't find the right on.
Anybody knows how to do it right?

Thx, Serge

Re: GetProperty of grid in form

Posted: Mon Jul 10, 2017 6:01 pm
by KDJ
Serge

I think in this way:
x1 := GetProperty(cFORM, 'Grid_1', 'Item', A)[1]
or
x1 := GetProperty(cFORM, 'Grid_1', 'Cell', A, 1)
or
x1 := GetProperty(cFORM, 'Grid_1', 'CellEx', A, 1)

Re: GetProperty of grid in form

Posted: Mon Jul 10, 2017 6:23 pm
by mol
As I remember, this phrase is ok

Code: Select all

x1 := GetProperty(cFORM, 'Grid_1', 'Item', A, 1)

Re: GetProperty of grid in form

Posted: Tue Jul 11, 2017 6:57 am
by serge_girard
Thanks !

The 3 options work (KDJ)
Now trying not to forget...

Serge