Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to get a persistent grid row Border?
Message
From
30/04/2008 16:11:14
 
 
To
12/07/2007 23:41:25
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01239912
Message ID:
01314352
Views:
14
Yahoo! I found a simple way to have a persistent row border in a grid, while allowing dynamic colors to show through for the current active row! Here it is for anyone who cares.

The answer is: Set Sparse = .F. for the columns where you want the dynamic color of the cells to show in the active row. One of the things Sparse = .f. does is it turns off the hightlighting of the column with a textbox while still maintaining the hightlight border around the entire row.

So, for example you can set:
Grid.HighlightRow = .t.
Grid.HighlightRowLineWidth = 3
Grid.HighlightStyle = 2

Column.Sparse = .f.
Column.Alignment = 3 (this is the default, but override it anyway. See below)
Set each column like this where you have a textbox control and you want the dynamic color to show for the current active row.

This works in VFP9 sp2. The reason I set Column.Alignment = 3 eventhough this may be the default, is that this somehow forces the text in the sparse textboxes to align centered. Otherwise, with sparse = .f., the margin in the textboxes are 0 and even setting the textbox margin doesn't help. Seems to be a small quirk to deal with if you want the text to not show flat up agaist the top border of the cells when sparse = .f.

Hope this helps someone. I tried so many things to simulate a border around the active row in order to have the dynamic colors show through for the active row, but none of them worked without issues I couldn't overcome.

Once again, 99% of the time, there seems to be a way to accomplish something in VFP!

-Mark
Previous
Reply
Map
View

Click here to load this message in the networking platform