Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using FOR EACH
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00193729
Message ID:
00193738
Views:
17
>>>I've got a form with a grid control on it that can have up to 132 columns in it (but they're only going to have a width of 10). I need to be able to modify each column so that it's Width is 10. It looked like the FOR EACH command was exactly what I was looking for, but it looks like it might not work.
>>>
>>> Here's what I tried:
>>>
>>>
>>>FOR EACH Column IN THISFORM.Grid1
>>>    Column.Width = 12
>>>NEXT
>>>
>>>
>>>Is there another way of accomplishing this?
>>
>>Grid.SetAll("Width",12,"Column")
>
>Cool. Now is there a way to walk through each column manually? I also need to change the Header.Caption of each new column. I had hoped:
>
>THISFORM.Grid1.SetAll("Caption",THISFORM.nCurrentCount,"Column.Header")
>
>With a _access method on nCurrentCount to bump the count would have worked, but again, no such luck.

here you should use loop:
FOR Each oColumn in Grid.Columns
 oColumn.Header1.Caption=alltrim(str(oColumn.ColumnOrder))
ENDFOR
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform