始终显示页脚模板,即使没有数据 [英] Always show FooterTemplate, even no data

查看:31
本文介绍了始终显示页脚模板,即使没有数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简短的方法可以使 FooterTemplate(在 GridView 中)始终可见,即使 DataSource 为空?

Is there a short way to make a FooterTemplate (in a GridView) always visible, even when DataSource is empty?

推荐答案

如果你想让它始终显示,而不管内容,你不能把页脚 html 放在 GridView 之外,而是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?

如果由于某种原因这不是一个选项,那么您可以如果数据源为空,则在数据源中添加一个空行,或者 子类 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).

这篇关于始终显示页脚模板,即使没有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆