?
Solved

BEHIND CODE GRIDVIEW HIGHLIGHT ON CONDITION

Posted on 2011-10-31
2
Medium Priority
?
390 Views
Last Modified: 2012-05-12
I have the follow behind code that I would like to place an additional condition into.   I need asssitence with the C# code behind.  I want to add additional highlight condition "Etops - Working" and highlight it "Yellow
when column 13 also meets this condition.


public partial class _Home1All : System.Web.UI.Page
{

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
      if (e.Row.RowType==DataControlRowType.DataRow)
                if (e.Row.Cells[13].Text == "AOG" || e.Row.Cells[13].Equals(DBNull.Value))  
                {  
                    e.Row.BackColor = System.Drawing.Color.LightPink;  
                }
 }

}
0
Comment
Question by:BOEING39
2 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 2000 total points
ID: 37057968
Something like this:

if (e.Row.Cells[13].Text == "AOG" || e.Row.Cells[13].Equals(DBNull.Value))  
                {  
                    e.Row.BackColor = System.Drawing.Color.LightPink;  
                }
else if (e.Row.Cells[13].Text == "SOMETHING")  
                {  
                    e.Row.BackColor = System.Drawing.Color.Yellow;  
                }

0
 

Author Closing Comment

by:BOEING39
ID: 37063899
Accurate quick answer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

839 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