How to set a row to different color when some case

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I want to show the background color of a row in a gridview to different
color when the value of a column is greater than 100.
How can I do?
 
PKJ said:
<a href=http://spamURLelided> is
a guide for technical interview questions, puzzles, hr questions,
interview tips. It has everything you need to prepare for microsoft
interview </a>

Let's simplify things. If you have a Microsoft interview arranged, you only
need *one thing* to prepare for it - a phone. Phone them up, say, "Sorry, I
suddenly had a fit of conscience, and I am no longer prepared to work for
the Evil Empire. I would like to cancel my interview."

This will save you a lot of time and hassle later.
 
hi Ad,
hook up an event like this to your gridview:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow &&
Int32.Parse(e.Row.Cells[0].Text) > 100)
e.Row.BackColor = System.Drawing.Color.Aquamarine;
}

this should do it.
tim
 
I agree. Personally, I don't want Microsoft to be hiring people who have to
cram in order to get a job there, because they will be writing the software
I use!

--

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.
 
Richard said:
PKJ said:


Let's simplify things. If you have a Microsoft interview arranged, you only
need *one thing* to prepare for it - a phone. Phone them up, say, "Sorry, I
suddenly had a fit of conscience, and I am no longer prepared to work for
the Evil Empire. I would like to cancel my interview."

This will save you a lot of time and hassle later.


LOL
 
<a href=http://www.emicrosoftinterview.com> eMicrosoftInterview.com is
a guide for technical interview questions, puzzles, hr questions,
interview tips. It has everything you need to prepare for microsoft
interview </a>

It looks like you are taking a Microsoft Interview. Would you like me
to:
Tell you not to spam newsgroups
Teach you to write decent English
Both of the above
 
Back
Top