始终显示FooterTemplate,甚至没有数据 [英] Always show FooterTemplate, even no data
问题描述
有没有做一个FooterTemplate(在GridView)短的路总是可见,即使数据源是空的?
Is there a short way to make a FooterTemplate (in a GridView) always visible, even when DataSource is empty?
推荐答案
如果你想让它始终显示,不管其内容如何,你不能只是把页脚HTML中的 GridView控件$外C $℃,而不是在>的
FooterTemplate
?
If you want it to always display, regardless of content, can't you just put the footer html outside the GridView
, instead of in the FooterTemplate
?
如果这不是出于某种原因的选项,那么您可以<一个href=\"http://weblogs.asp.net/bradygaster/archive/2006/10/24/Empty-GridView%5F2C00%5F-Invisible-Footer.aspx\">add如果它是一个空行到数据源空,或子类 GridView控件
&安培;覆盖默认行为。
If that's not an option for some reason, then you can either add an null row to your data source if it's empty, or subclass the GridView
& override the default behaviour.
这些是我所知道的唯一的选择(尽管它已经有一段时间,因为我用最后一次 GridView控件
)。
Those are the only options I'm aware of (although its been a while since the last time I used a GridView
).
这篇关于始终显示FooterTemplate,甚至没有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!