css 设置好TD 同时存在treeview与gridview的时候

来源:互联网 发布:淘宝网茵曼 编辑:程序博客网 时间:2024/05/29 02:54

让treeview不显示td网格线 gridview显示网格线

 

HTML 

<style type="text/css">
        TD
        {
            font-size: 9pt;
            color: #000000;
            font-family: 宋体;
            border-right: #6C9FDB 0px solid;
            border-top: #6C9FDB 0px solid;
            border-left: #6C9FDB 0px solid;
            border-bottom: #6C9FDB 0px solid;
            border-collapse: collapse;
        }
    </style>

 

.cs

 protected void myDataGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[1].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[2].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[3].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[4].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[5].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[6].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[7].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[8].Attributes.Add("style", "border:1px   #6C9FDB");
            e.Row.Cells[9].Attributes.Add("style", "border:1px   #6C9FDB");
        }  
    }

原创粉丝点击