GridView RowDataBound事件选择中颜色变色

    技术2024-08-07  63

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("OnMouseOver", "c=this.style.backgroundColor;this.style.backgroundColor='#5D7B9D';"); e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor=c;"); } }

    最新回复(0)