Gridview:无法删除边框

时间:2012-12-04 20:56:41

标签: c# asp.net

我在GridView单元格中有一个gridview,如图所示。我试图删除2个水平线,我认为这些线是在单词下面的边框以及下面的单词之外。

enter image description here

 foreach (TableCell tc in e.Row.Cells)
        {
            tc.Attributes["style"] = "border-bottom-style:none";
            tc.Attributes["style"] = "border-width:0px";
            tc.Attributes["style"] = "border-top-style:none";
        }

但它不起作用。任何帮助?

1 个答案:

答案 0 :(得分:12)

将以下属性添加到GridView

GridLines="None"

这应删除所有边框。