Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternating lines on a grid
Message
From
07/04/2000 03:57:56
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00356606
Message ID:
00356695
Views:
12
Hi Robin.

>>If your record order within a grid control is not in record number order is there anyway of alternating the background colour of each line in the grid? <<

Not easily. The only thing that I can think of (off the top of my head) would be to bind the grid to an updateable cursor or local view with an extra field called nRecOrder or something like that. After the cursor or view was populated and in the desired order, you'd have to initialize a counter to 0, scan it, increment the counter inside the loop, and replace nRecOrder with its value. Then, you could issue this command:

Thisform.MyGrid.SetAll("DynamicBackColor", "IIF(MOD(nRecOrder, 2)=0, RGB(255,255,255), RGB(0,255,255))", "Column")

Very clunky and definitely not a good idea for large tables, but it could work.

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform