如何在webgrid中隐藏列标题 [英] How hide a column header in webgrid
本文介绍了如何在webgrid中隐藏列标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< div id = gridContent >
@ grid.GetHtml(tableStyle: webGrid ,
headerStyle: header,
alternatingRowStyle: alt,
selectedRowStyle: 选择,
列:grid.Columns(
grid.Column( 名称, 名称,style: description),
grid.Column( DomainName, 域名,style: hide)
< / div >
< style 类型 = text / css >
.hide {display:none;}
< 风格 >
像这样我试图隐藏列但列标题无法隐藏我如何隐藏此列中的列标题
所以最后我想隐藏DomianName列如何我可以吗?
解决方案
这个链接可以帮到你
http://social.msdn。 microsoft.com/Forums/vstudio/en-US/0e1b1893-206f-4440-a36e-f376b8a2a060/hide-column-header-in-gridview [ ^ ]
记下eq()中的列索引,它会将它放在document.ready()函数中
(' 。grid table thead tr th:eq (8)'跨度>)隐藏();
<div id="gridContent">
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Name", "Name", style: "description"),
grid.Column("DomainName", "Domain Name",style:"hide")
</div>
<style type="text/css">
.hide {display:none;}
<style>
Like this I am trying to hide the column but column header not able to hide how can I hide the column header in this
So finally I want to hide DomianName column how can I?
解决方案
This link may help you
http://social.msdn.microsoft.com/Forums/vstudio/en-US/0e1b1893-206f-4440-a36e-f376b8a2a060/hide-column-header-in-gridview[^]
write down column index in eq() and it will work put this in document.ready() function
('.grid table thead tr th:eq(8)').hide();
这篇关于如何在webgrid中隐藏列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文