Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Paint rows in a grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00952058
Message ID:
00952215
Views:
9
I guess I misunderstood Anders when he mentionned this in his post : (I do not like to use different table sources for the grid).

>?-|
>
>You can create cursor with ID as source table by current order, add relation from source table to cursor.
>
>MartinJ
>
>>I did not know the record count, so I offered a possible solution.
>>And what solution would you offer?
>>
>>>Mike,
>>>
>>>Value of property ActiveRow is greater then 0, if grid has focus.
>>>This solution is best for tables or cursors with a few records (less then 100).
>>>
>>>MartinJ
>>>
>>>>If you use the following in the init of the grid:
>>>>
WITH THIS
>>>>   .SetAll("dynamicbackcolor",;
>>>>      "IIF(MOD(this.activerow, 2) # 0,RGB(254,254,210), RGB(255,255,255))", "Column")
>>>>ENDWITH
>>>>
>>>>And when you change the order of the table, use the following code
>>>>
SELECT dvdprice
>>>>SET ORDER TO LISTPRICE   && The index use to be ID
>>>>thisform.grid1.Init()
>>>>thisform.Refresh()
>>>>thisform.grid1.SetFocus()
>>>>
>>>>This seems to work properly at my end.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>In a grid the rows are painted by using the column property DynamicBackColor, which is set to
>>>>>IIF(MOD(RECNO(),2)=1,RGB(255,255,196),RGB(206,255,206)). This looks fine but however, by using an index on the referenced table the row colors are not any longer every other green and every other yellow. This is of course the obvious result of the property setting. However, is there any other way of doing this allowing the result to be every other row to be in one color and every other row in another color despite you use an index or not on the table? (I do not like to use different table sources for the grid).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform