protected void GVMtrPoint_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex >= 0) { e.Row.Attributes.Add("onmouseover", "this.name=this.style.backgroundColor;this.style.backgroundColor='Honeydew';this.style.color='blue'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.name;this.style.color='black'"); e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#6699ff';"); //((Label)e.Row.Cells[1].FindControl("lbl_order")).Text = (e.Row.RowIndex + 1).ToString(); } }
转载于:https://www.cnblogs.com/kingkongv/archive/2012/11/19/2777502.html