how can i put a diferente colour in a grid line

how can I put different colors in the lines of a visual foxpro grid so as to highlight certain items.
thanks
luciliacoelhoAsked:
Who is Participating?
 
pcelbaConnect With a Mentor Commented:
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
 
pcelbaCommented:
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
 
luciliacoelhoAuthor Commented:
thanks very much, for the topics. What i want is to change the color of the line numer p.e. 100.
0
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.