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

VB.net color code gridview

Hi

In VB.net is it possible to color different columns or cells?
0
Murray Brown
Asked:
Murray Brown
3 Solutions
 
Pratima PharandeCommented:
Here Sample code try this,Let 4 is cell number



 protected void GridviewName_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.Cells[4].Text == "Closed")
            {
 
                e.Row.Cells[4].ForeColor = Color.Green;
 
            }
            if (e.Row.Cells[4].Text == "Open")
            {
 
                e.Row.Cells[4].ForeColor = Color.Red;
 
            }
}
0
 
DhaestCommented:
For webbased gridview

GridView Examples for ASP.NET 2.0: Formatting the GridView
http://msdn.microsoft.com/en-us/library/aa479342.aspx
0
 
DhaestCommented:
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Wow that was fast. Great answers
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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