>Can anyone help me to use FOR EACH command
>
>eg. FOR EACH column IN THISFORM.GRID1 ?????
>
>
>Now I am using
>
>FOR mCnt = 1 TO THISFORM.grid1.columncount
> THISFORM.grid1.columns(mCnt).READONLY = 'DDD'
>ENDFOR
>
>TIA.
You can use 'for each' wih any type of collection, even the array. For grids here is a sample :
for each oColumn in thisform.Grid1.Columns
if upper(oColumn.Controlsource) # 'MYALIAS'
oColumn.ReadOnly = .T.
endif
endfor
In your sample SetAll is a shortcut :
THISFORM.grid1.SetAll('ReadOnly',.t.,'Column') && Readonly is logical
Cetin