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

Displaying and Choosing a Color for an Item in a Grid

Status
Not open for further replies.

pvava

Programmer
Feb 11, 2010
3
US
Any Ideas? I want to have a user choose a color associated to each item in a table. I want the user to be able to select that color in a grid. So they could click in a column of the grid that is bound to the colorvalue variable of the record and popup the colorpicker. I want the grid to reflect the color associated with the record in the colorvalue column.

Hope this makes sense.

Thanks in advance
 
1. DynamicForeColor = "alias.colorfield"
2. alias.colorfield = GetColor()

Bye, Olaf.
 
But wouldn't that turn the whole row the color. I am looking to just have the color in the cell of each row, not the entire row.
 
The DynamicForeColor and DynamicBackColor settings are applied Column-by-Column to the Grid.
And their expression is conditional on parameters within specific Records.
Thereby affecting (or not) single 'cells' of the Grid.

Try it and see the results.

Good Luck,
JRB-Bldr
 
Pvava,

It's not clear from your question exactly what you are trying to achieve. However, you might find this article useful:

Conditional formatting in a Visual FoxPro grid

Essentially, it explains how to use the DynamicXXX properties to change the colour (or other formatting) of a single cell.

If that doesn't answer your question, perhaps you could clarify what you want to know. In particular, what does "a user choose a color associated to each item in a table" mean? And also how a grid can be bound to a "colorvalue variable"?

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yep, I got it to work. I set the dynamicBack and Fore Color for the Column to the color variable in my table and it works.

Thanks to all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top