protected void gvMoreSize_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

for (int j = 0; j < this.gvMoreSize.Rows.Count + 1; j++)
            {
                //首先判断是否是数据行
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    //当鼠标停留时更改背景色
                    e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.color='#116a79';this.style.backgroundColor='#cef97b'");
                    //当鼠标移开时还原背景色
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;this.style.color='#3a6381'");
                    e.Row.Attributes["style"] = "Cursor:pointer";
                }
            }

}

posted on 2011-09-08 17:24  易尔购  阅读(2363)  评论(0编辑  收藏  举报