Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting a column in a grid
Message
From
10/07/2001 13:55:37
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00528362
Message ID:
00528786
Views:
19
>Hi Marcia,
>
>What I wanted to do is have alternating column colors in the grid, but I now have: blue, white, white, blue, white, blue, etc.
>
>Fox has it's own ordering sequence. The columns appear as I wanted them(Col_1,Col_10,Col_2,Col_3,etc.). The FOR EACH loop uses Fox's ordering!
>
>Julian


Try this:
*-- Grid.Init
Local loColumn     
For Each loColumn In this.Columns
  thisform.SetColumnBackColor(loColumn)
EndFor

*-- wherever you add the column (e.g., a button Click event)...
Local loColumn     
With ThisForm.grdNames
  .ColumnCount = .ColumnCount + 1
  loColumn = .Columns(.ColumnCount)
  thisform.SetColumnBackColor(loColumn)
EndWith

*-- custom method, SetColumnBackColor
LPARAMETERS toColumn
Local lcFormPath     
lcFormPath = Strtran(Sys(1272, toColumn), Lower(this.Name), "_screen.Activeform")
toColumn.DynamicBackColor = "IIf(" + ;
  lcFormPath + ".ColumnOrder%2=0,RGB(255,255,255),RGB(0,0,255))"
toColumn.Parent.Refresh()
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform