Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
For Each
Message
From
31/10/2001 05:16:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/10/2001 04:37:47
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00575508
Message ID:
00575515
Views:
15
>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 && Columns is a collection
 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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform