Solved

how can i put a diferente colour in a grid line

Posted on 2011-03-06
4
348 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 41

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 41

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now