Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid DynamicBackColor property
Message
From
10/06/2003 22:29:13
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Grid DynamicBackColor property
Miscellaneous
Thread ID:
00798731
Message ID:
00798731
Views:
90
Hi All,

I want to have an alternate back color on the row of the grid.
I know that we can set it based on the example in the help as follows:

example (this code in the Init() of the grid):

This.SetAll("dynamicbackcolor", "IIF(RecNo()%2 = 0,RGB(230,243,255), RGB(255,255,255))", "Column")
The above code will properly on the table with no index.

However my application want to sort the record in the grid using index by just clicking on the column header similar to the Task of MS Outlook (on first click it will sort by ascending order. If the user click again the same column it will resort by descending order).

The problem is when use a table with index it will not display the alternate back color properly. The desire appearance must be (e.g. all odd rows are with a back color of blue and all even rows must have a back color of white). But when the table have an index and resort the record it will not display the alternate color accordingly because the record arrangement does not follow the RecNo().

I have try to change the code to use ActiveRow property of the grid instead of RecNo() as follows:

This.SetAll("dynamicbackcolor", "IIF(This.ActiveRow%2 = 0,RGB(230,243,255), RGB(255,255,255))", "Column")
Using this code will correct the alternate back color. However if the grid contains more records and scroll it using the scroll bar some of the record in the bottom does work properly with alternate back color.

Is anybody can help me to solve this issue?

Thank you in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform