如何在MVC3 WebGrid上隐藏标题 [英] How to hide header on MVC3 WebGrid
本文介绍了如何在MVC3 WebGrid上隐藏标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一些简单的方法来隐藏MVC3 WebGrid扩展的标头?
Is there some easy way to hide header for MVC3 WebGrid extension? Something like
var grid = new WebGrid(Model, canSort:false, canPage:false, showHeader:false);
尽管我希望通过代码完成此操作,但我可能可以为标题设置css样式,这将导致标题不显示.
I can probably set css style for header that will cause header not showing, though I'd rather have this done via code.
谢谢
Antonin
推荐答案
您可以将其传递给GetHtml
方法:
You could pass it to the GetHtml
method:
@grid.GetHtml(displayHeader: false)
有关其他选项,您可以查看以下博客文章
For additional options you may take a look at the following blog post.
这篇关于如何在MVC3 WebGrid上隐藏标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文