Saturday, May 28, 2011

Gridview_RowCreated Event

 protected void grdData_RowCreated(object sender, GridViewRowEventArgs e)
 {
  if ((e.Row.RowType == DataControlRowType.DataRow) &&  
                       (e.Row.RowState == DataControlRowState.Selected))
   {        
   string strCellvalue = DataBinder.Eval(e.Row.DataItem, "categoryname").ToString();     if (strCellvalue == "Admin")      
    {
      e.Row.BackColor = System.Drawing.Color.LightPink;
    }
  }
 }


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More