Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting a column in a grid
Message
From
10/07/2001 11:22:42
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00528362
Message ID:
00528651
Views:
17
>Thanks Trey, I have also found I can click and drag a column. So if I increase the columncount by 1 (as you suggested) it adds the new column. I then clicked and draged the column to where I wanted it!
>
>However, in a FOR EACH oCol in THISFORM.grdAsso.COLUMNS, VFP still thinks it's the 10th column and not the 2nd, which it appears to be.
>
>Thanks again for the input.
>Julian
>
>PS: Any thoughts on this ordering?

Column Index is what For Each and Columns(i) uses. It's always the order they were added in.
What are you checking in that For Each loop to see if it's the 2nd column?
Checking the ColumnOrder should do it.
One other way would be do a double loop, e.g.
With thisform.grdAsso
  For ji = 1 to .ColumnCount
    For Each loCol In .Columns
      If loCol.ColumnOrder = ji
        ** this is the column in visual order
      EndIf
    EndFor
  EndFor
EndWith
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform