常用改变选中行颜色

protected void GVMtrPoint_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowIndex >= 0)
        {
            e.Row.Attributes.Add("onmouseover", "this.name=this.style.backgroundColor;this.style.backgroundColor='Honeydew';this.style.color='blue'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.name;this.style.color='black'");
            e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#6699ff';");
            //((Label)e.Row.Cells[1].FindControl("lbl_order")).Text = (e.Row.RowIndex + 1).ToString();
        }
    }
posted @ 2012-11-19 16:27  泽刚  阅读(306)  评论(0编辑  收藏  举报