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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help keeping row colors in sync on grid

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi!
I have 2 grids. One has 1 column used to select data for second grid. This grid has 2 columns.

I have my selected rows displaying in the colors I want except I can't seem to find a way to have the row in both columns to show 'selected' when I click on either. How can I make the ROW be selected when either column is clicked with the mouse or moved to with up-down arrows?

My grids are based on examples from "1001 Things..." but that example has only one column in both grids and I can't seem to be able to extend it.

Thanks for a push.

Judi
 
Code:
thisform.Grid1.SetAll([DynamicBackColor],;
            [IIF(Condition for selected row,;
                 RGB(color for selected row),;
                 RGB(color for non selected row))],[Column])

Borislav Borissov
 
WOW!
Hardly got it posted before you are here with an answer. I will work it in. Thanks so much.

Judi
 
Borislav,

When I went to implement your suggestion, I discovered that is exactly what I am doing.

Stepping through debug, I see that it IS highlighting both columns so I must be changing that somewhere else and just can't catch it. At least now I know to look at something else.

Thanks.

Judi
 

Judi,

The ideal answer is that you should set the grid's HighlightStyle property to 2 and its AllowCellSelection to .F.

But, if I remember right, you are using VFP 6.0. Unfortunately, those properties didn't arrive until VFP 8.0.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Thanks for the response. Yes, I am still using 6.0. You have just given me one more reason to upgrade. It is a lot of expense for me as I have only a few projects lined up and don't know it I will pursue others. The ones I have committed to are for a local company that I did work for many years ago. I felt I kind of owed it to them and besides it would be fun!
It has been fun, expecially realizing that help like this forum was available, but I don't know how much farther I will take it. After all, I just retired from my real job!

I have the row coloring in the secord grid working properly but somewhere in fixing that I lost the coloring in the row selected in the first grid.

Is there a VFP 6.0 'ideal solution for that one?

Thanks for any thoughts.

Judi
 
Hi!

Just to close the thread, I have found my solution to the problem. I just failed to reset coloring in one place. Got a lot more comfortable with DEBUG doing it.[smile]

Judi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top