对gridview的每一行添加属性的小实例

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if ((ListItemType)e.Row.RowType != ListItemType.Header)
        {
            e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;
this.style.backgroundColor='#6699ff'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
        }
    }

你可能感兴趣的:(C++,c,C#)