Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternating colors in Grids
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00880671
Message ID:
00880726
Views:
19
Hi Rudy,

Just another thought / approach. You might want to try this:
1) set the index
2) bind the control to the data
3) spin through the data rows
4) for each row, use the ActiveRow / RelativeRow property to determine your desired offset

I know it's not the one-statement SetAll() solution you were looking for, but that type of approach should work in all cases.

>We use the following code to alternate the colors of the lines in a grid, i.e. Yellow, Green, Yellow, etc. It works great, until we sort the cursor using a temporary index. After re-ordering, RECNO() is no longer 1,2,3... but could be 2,4,3.. which messes up the alternating colors. Does anyone know of a way to dtermine the actual physical row number in the grid instead of using the record number from the cursor? This would guarantee the lines would alternate under all conditions. Or any other ideas to help make this work?
>
>Thanks,
>
>Bryan A. Jackson
>for Rudy Nieves
>
>THIS.SetAll( "DynamicBackColor", IIF( MOD( RECNO(), 2 ) = 0, RGB(187,217,168), RGB(255,255,190) )", "Column" )
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Reply
Map
View

Click here to load this message in the networking platform