IE 和 FF 中的网格线颜色
我在 gridview 上将网格线设置为 true,我希望线条为灰色。 默认情况下,由于我的样式表,IE 中的线条显示为灰色;但在 Firefox 中,标题列之间有一条黑线分隔。
我尝试添加
this.GridView1.Attributes.Add("bordercolor", "#ddd");
这修复了 FireFox 问题,但在 IE 中它显示黑线。
I have gridlines set to true on a gridview, i want the lines to be grey.
By default, the lines in IE appear grey, due to my stylesheets; but in Firefox, there is a dark line separating the header columns.
I have tried adding
this.GridView1.Attributes.Add("bordercolor", "#ddd");
This fixes the FireFox issue, but in IE it shows the dark lines.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老话题,但也需要解决方案,而 @rism 的解决方案不适用,所以我想出了最简单的方案。
在CSS中
I know it's an old topic but needed solution for this too and @rism's solution did not apply , so i came up with simplest of all.
in css
您以编程方式执行此操作是否有原因?
如果打开 html 文件(.ascx、.aspx),您应该能够在网格上使用 style="border:1pxsolid #ddd;" 设置内联样式或者最好使用网格的 CssClass 属性并将其指向外部定义的样式
CssClass="myGridStyle"
其中 myGridStyle 定义为Is there a reason why you are doing this programmatically?
If you open the html file (.ascx, .aspx) you should be able to set an inline style on the grid with style="border:1px solid #ddd;" or preferably use the CssClass property of the grid and point it at an externally defined style
CssClass="myGridStyle"
where myGridStyle is defined as