Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Row Highlighting...

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
0
0
GB
Hi guys

Have been going round in circles with this problem, but am certain it must be an easy fix!

Basically I have a 'read-only' grid that has the rows coloured differently depending on certain criteria. So far, so good :)

All I am trying to accomplish is to have the 'frame' around the row shown on the on the selected record. I thought that Highlight = .F., HighlightRow = .T. and AllowCellSelection = .F. would be all I would need.

But it would appear that if you set AllowCellSelection = .F., the entire row is highlighted with a solid colour, which is no good as I need to be able to see the colour the row has been set to. AllowCellSelection = .T. gives me the outline I am after, but allows the use to click on a cell which is then highlighted with a different colour (I added RETURN .F. to the WHEN event of the text boxes to try and prevent this but that did not work).

What am I missing?? This is VFP8 if it matters!

thanks
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Neil,

Have you tried the different settings of the HighlightStyle property? And also HighlightForeColor and HighlightBackColor?

Between them, they might be able to give you the effect you are looking for.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike

Yeah, I fiddled with all the different settings/properties but no combination (unless I have missed one!) seems to do what I need.

Oh well, it's not a show stopper just annoying :)

Thanks
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
If the purpose of the "frame" is to show the user which row is selected, maybe you can find some other way of doing that. For example, show the selected row in bold; or add a little graphic device such as a blob, and show this in the left-most column for the selected row.

Just a thought. It probably won't look as good as the frame.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike

I have found a way round! Quite simple in the end thankfully :)

In the AfteRowColChange event, I just added code to change the HighlightBackColor to that of the row by using the same criteria as the DynamicBackColor change for the grid.

I now have the frame and no cell selection.

thanks
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top