Monday, December 27, 2010

Change Row color in gridview C#

change Row color in gridview C#

public void gridViewMaster_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
    

    if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Type")).ToString().Trim() == "Media3")
            {
                e.Row.BackColor = Color.Yellow;
            }
    }

No comments: