Solved

how can i put a diferente colour in a grid line

Posted on 2011-03-06
4
352 Views
Last Modified: 2012-05-11
how can I put different colors in the lines of a visual foxpro grid so as to highlight certain items.
thanks
0
Comment
Question by:luciliacoelho
  • 2
4 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 35048418
You may use DynamicForeColor and DynamicBackColor of the Column. To highlite each the second line you may use following code:

THIS.setall("Dynamicbackcolor", "IIF(RECNO()%2=0,RGB(255,255,0),RGB(192,192,192))","Column")

in Grid.Init method code.
0
 

Author Comment

by:luciliacoelho
ID: 35048612
thanks very much, for the topics. What i want is to change the color of the line numer p.e. 100.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 35048915
So, I hope you don't need an update but here it is:

THIS.setall("Dynamicbackcolor", "IIF(RECNO() = 100,RGB(255,255,0),RGB(192,192,192))","Column")

You just have to keep the dynamic expression shorter than 255 characters.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 35053370
You can also use ICASE() instead of IF() for more choices
ICASE(logical1,color1,logical2,color2,...,colorn)

Or you can call a function that returns a color.
CategoryColor(query.category)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DataAdapter, stored procedures and parameters 2 53
Need more details 5 182
Need an intro to -- .Net SQL Authorization Manager 7 95
Please explain purpose of GZIP 4 56
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question