Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid DynamicBackColor
Message
From
18/12/1997 10:01:26
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00066890
Message ID:
00066895
Views:
49
>>>I have a grid in which I want every other line to be a different color. Using the example in VFP's help of using the MOD of RECNO() isn't practical. Is there a way I can do something like the MOD of the grids row numbers or does anyone else have another suggestion?
>>
>>IMHO, the best way is to add one more field into Grid.Recordsource and fill it with real backcolor property values. Then you just reevaluate DynamicBackColor property using this field value.
>
>I don't understand how this will help. Could you please elaborate? Thanks.

Ok. Let say, you use cursor as Grid.Recordsource. This cursor will contain field 'rowbackcolor' populated with real color values different for each record, e.g. 16777215,0,12632256,etc. (see Backcolor property in Help). Now you just issue:
cLine="gridcursor.rowbackcolor"
this.setall("dynamicbackcolor",cLine,"column")
And all rows get different color. Surely, it's applied for reasonably small cursors. If your recordsource is really big you better use RECNO().
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform