I try to find out in code if a grid is controlled by an dbf (rowsource) or an array (items).
I tried the following code but is always returns NIL
MsgDebug(GetProperty("Form_1,"Grid_1","RowSource"))
I also tried
MsgDebug(GetProperty("Form_1,"Grid_1","Items"))
Same result, always NIL
Any other way to find out if an array has a rowsource (dbf) of an array (items) ?
Is a grid controlled by an array or a dbf ???
Moderator: Rathinagiri
Re: Is a grid controlled by an array or a dbf ???
Try to look at h_grid.prg in hmg\src and analyze where these properties are stored.
I'm writing from tablet, so I can't look at sources now.
I'm writing from tablet, so I can't look at sources now.
Re: Is a grid controlled by an array or a dbf ???
try this:
MsgInfo(IF(Getownerdata("Grid_1","Form_1"),'DBF','ARRAY'))
MsgInfo(IF(Getownerdata("Grid_1","Form_1"),'DBF','ARRAY'))
Code: Select all
Function Getownerdata(cGridName,cFrmName)
Local x_ := GetControlIndex(cGridName,cFrmName)
Return (_HMG_SYSDATA [ 40 ] [ x_ ] [ 9 ])
Re: Is a grid controlled by an array or a dbf ???
Marek, thanks for your response. I found _HMG_SYSDATA [ 40 ] [ k ] [ 10 ] for the cDataSource in the source files.
But Toledo really helped me out. _HMG_SYSDATA [ 40 ] [ x_ ] [ 9 ] was exactly what i needed ! It returns True for a DBF and False for an Array, Excellent !!!
Thanks again Toledo for helping me out !
But Toledo really helped me out. _HMG_SYSDATA [ 40 ] [ x_ ] [ 9 ] was exactly what i needed ! It returns True for a DBF and False for an Array, Excellent !!!
Thanks again Toledo for helping me out !