GridView控件呈现为div [英] gridview rendered in div
本文介绍了GridView控件呈现为div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个更新面板内的内容模板内一个gridview。
该ASPX就是这样:
I have a gridview inside a content template inside an update panel. The aspx is like that:
<asp:UpdatePanel ...>
<ContentTemplate>
<asp:Panel ...>
....
</asp:Panel>
<asp:GridView....>
....
</asp:GridView>
<asp:Panel>
....
</asp:Panel>
</ContentPanel>
</asp:UpdatePanel>
问题是,呈现的HTML看起来,当涉及到GridView:
The problem is that the rendered HTML looks like that when it comes to the gridview:
<div>
<table>
......
</table>
</div>
表被包裹在一个div我没有控制权。任何方式禁用?或者给它一个ID,这样我可以用CSS控制吗?
The table is wrapped in a div I have no control over. Any way to disable that? Or give it an ID so that I can control it with CSS?
让我知道你是否有同样的问题。
Let me know if you've have the same issue.
感谢。
推荐答案
我认为你正在寻找的东西是这样的:的 http://www.atashbahar.com/post/GridView-makeover-using-CSS.aspx
I think you're looking for something like this : http://www.atashbahar.com/post/GridView-makeover-using-CSS.aspx
所以,你可以这样做:
<asp:GridView ID="gvCustomres" ...
CssClass="mGrid"
PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt">
这篇关于GridView控件呈现为div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文