当前位置:编程学习 > C#/ASP.NET >>

怎么样将DataGrid里面的选中行的背景颜色改变,版本VS2005

怎么样将DataGrid里面的选中行的背景颜色改变,版本VS2005 --------------------编程问答-------------------- 有属性的啊 --------------------编程问答-------------------- 可以通过属性去设置,也可以在后台代码中修改,也可以通过JS去设置样式...方法很多 --------------------编程问答-------------------- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //如果数据行是绑定的
            if (e.Row.RowType == DataControlRowType.DataRow)  //判断数据行是否是绑定的
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFCC66'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
                e.Row.Attributes.Add("onclick", "this.style.backgroundColor='ORANGE'");
            }
        } --------------------编程问答-------------------- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //如果数据行是绑定的
            if (e.Row.RowType == DataControlRowType.DataRow)  //判断数据行是否是绑定的
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFCC66'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
                e.Row.Attributes.Add("onclick", "this.style.backgroundColor='ORANGE'");
--------------------编程问答--------------------
补充:.NET技术 ,  组件/控件开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,