28
2012
03

Datagridview绑定数据时行变色,数据行自动编号

//黑白颜色变化
protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
{
//首先判断是否是数据行
if (e.Row.RowType == DataControlRowType.DataRow)
{
//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFFFFF'");
...
«1»