Pastel Colors?

G

Guest

Hi,
I'm trying to set the background color of a datagrid cell into a pastel color.

I can change this into other colors in the grid_ItemDataBound event thus:
e.Item.Cells(3).BackColor = System.Drawing.Color.Green
or
e.Item.Cells(3).BackColor = System.Drawing.Color.Red
(dependent on particular values in some of the columns) but these seem
pretty garish to me.

How can I set these to non-standard colors - in a variety of pastel shades?
Hopefully knowing how I can set these colors without relying on
System.Drawing.Color.(something) will be enough to get me on my way.

Many thanks!
 
I

IfThenElse

Define new color object

System.Drawing.Color newColor = new System.Drawing.Color();

Assign it RGB values or ARGB

newColor = System.Drawing.Color.FromArgb(int red, int green, int blue)
 
S

Scott M.

I belive you can also assign non-standard colors via the property window by
directly entering rgb comma separated values: 255,255,255
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top