Datagrid Questions

V

Vayse

I wish to do a grid of sales per quarter by Salesman.
So, layout like this:

SALES PERSON Q1 Q2 Q3 Q4
John 5 6 7 8
Jane 3 2 1 9

There's two things I'd like to do, and let the user choose these options on
a button
1)
If the sales for a quarter are higher than the previous quarter, give the
cell a green background.

2)
There is a target for each quarter. I'd like the background for the cell to
be shaded as a percentage of the target.
For example, lets say Q1 sales were 7,500 and the target was 10,000. I'd
like the background of the Q1 cell to be three quarters green.
Is this even possible?

Thanks
Vayse
 
K

Kevin Yu [MSFT]

Hi Vayse,

Yes, this is possible. To achieve this, you have to code a customized
DataGridViewColumn. You can inherit your own column style from this class,
and draw the green color on each cell. Please check the following document
for more information about DataGridView.

http://www.windowsforms.net/Samples/Go To Market/DataGridView/DataGridVi
ew%20FAQ.doc

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top