日期:2014-05-18 浏览次数:20475 次
#region 绑定行事件 /// <summary> /// 绑定行事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GvList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex != -1) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#eef7fe'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'"); } int id = e.Row.RowIndex + 1; e.Row.Cells[0].Text = id.ToString(); if (e.Row.Cells[5].Controls.Count != 0) { ((LinkButton)e.Row.Cells[5].Controls[0]).Attributes.Add("onclick", "return confirm('确定删除此条纪录吗?')"); } if (e.Row.Cells[4].Controls.Count > 1) { ((LinkButton)e.Row.Cells[4].Controls[0]).Attributes.Add("onclick", "return confirm('确定更新此条纪录吗?')"); } } } #endregion