• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

BEHIND CODE GRIDVIEW HIGHLIGHT ON CONDITION

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
BOEING39
Asked:
BOEING39
1 Solution
 
strickddCommented:
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
 
BOEING39Author Commented:
Accurate quick answer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now