Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and highlighting rows (yes again, darn it!)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00030281
Message ID:
00030288
Views:
34
>I have yet to find a way to show which record you are on in a grid unless the grid has focus. The closes I have come is once the grid has focus and looses focus, the row that was last selected is a different color. But, if you navigate to a different row the colored row will not change until the grid has focus again.
>
>I've looked in the MS knowledge base. Lot of neat stuff there, but not this. Could anyone give me specific code or ideas on how to highlight a grid row that corresponds to the current record when navigating without the grid having focus?
>
>I feel like I'm searching for the Holy Grail and if someone doesn't help me I'll start on my Monty Python jokes.
>
>Michael G. Emmons

You can do this in several ways. I store the record number of the cursor the grid is based on, and increment it in the gotfocus event of all the grid fields. In the init and when of the grid I have the following code, which results in the record you are on being highlighted in gray. Onrecord is the variable that stores the cursor record number. If you want this to work when you are off the grid, make it a method and just set onrecord before calling it.


this.SetAll("DynamicBackColor", ;
"IIF(onrecord=recno('itemlist') and itemlist.record<>0, rgb(192,192,192) ;
, RGB(255,255,255))", "Column")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform