Posted on 2011-10-31
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;  

Question by:BOEING39
    LVL 28

    Accepted Solution

    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;  


    Author Closing Comment

    Accurate quick answer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    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…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 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

    20 Experts available now in Live!

    Get 1:1 Help Now