This example shows how to change grid view row color and set tool tip on

Santosh0683
Posted by Santosh0683 under ASP.NET category on | Points: 40 | Views : 4281
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow pr = ((DataRowView)e.Row.DataItem).Row;
if (pr["IsActive"].ToString() == "True")
{
e.Row.ForeColor = System.Drawing.Color.Red;
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#f7fff8';");
e.Row.ToolTip = "Your a/c has been denied!";
}
else
{
e.Row.ForeColor = System.Drawing.Color.Blue;
}
}
}

Comments or Responses

Login to post response