删除EmptyDataTemplate边界 [英] Remove EmptyDataTemplate border
问题描述
我在ASP.NET自定义CSS样式,包括边框的GridView。该EmptyItemTemplate有一个消息:没有找到结果,但具有我想删除的边框。我知道这个code:
I have a GridView in ASP.NET with custom CSS styling, including a border. The EmptyItemTemplate has a message: "No results found" but has a border which I want to remove. I know about this code:
<EmptyDataRowStyle BorderWidth="0" />
然而,这适用于该行,而不是表本身 - 所以表格边框依然存在。我也试着将一个自定义的CSS类的EmptyDataRowStyle,但适用于该行,而不是表本身。
However, this applies to the row, not the table itself--so the table border remains. I've also tried applying a custom CSS class to the EmptyDataRowStyle, but this applies to the row, not the table itself.
那么,如何去除了EmptyDataTemplate边界?
So how do I remove the border on the EmptyDataTemplate?
推荐答案
我结束了使用jQuery。我已将此添加到GridView控件:
I ended up using jQuery. I added this to the GridView:
<EmptyDataRowStyle CssClass="EmptyData" />
,然后加入这个jQuery在页面的底部:
And then added this jQuery at the bottom of the page:
$(".EmptyData").parents("table").css("border-width", "0px").prop("border", "0");
这篇关于删除EmptyDataTemplate边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!