Solved

How to color the cells in a datacolumn? Vb.net

Posted on 2004-04-14
3
223 Views
Last Modified: 2010-04-17
Hi,
    I am new to vb.net, and I have a question regarding how to color-code the cells in a dataset.  I have 2 tables in a dataset: revenue and expense.  Now what I need is to color the cells based on their values.
   This is an example of how the revenue table looks like:

                                   1999                       2000                2001
Shoes                           97.5                        55.6                  78.5
Jewelry                        105.1                      ------                 97.5
Clothes                         -----                       15.5                  14.8
bags                             45.8                        -----                  25.6

   The dashes means that there are no data available.  Now my problem is to color the fields according to their values.  For example, for year 2001, I need to color the field with highest value to be red = RGB(255, 0, 0) and the lowest value to be black = RGB(0, 0, 0).  Then the rest distribute the color evenly.
I tried to use the paint method from here, but that only work if you color the cell based on value range, HOW CAN I LOOP THROUGH THE COLUMN AND COLOR BASED ON THEIR VALUE?
    Thanks in advance!
0
Comment
Question by:iamnotexpert
3 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 125 total points
ID: 10828988
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

Suggested Solutions

Title # Comments Views Activity
array11 challenge 16 59
mapShare challenge 13 89
Microsoft C++ code failing in executable that worked 9 85
Advice in Xamarin 21 52
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

911 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

16 Experts available now in Live!

Get 1:1 Help Now