在数据源为空时显示gridview的标题 [英] To display the headers of gridview when the data soucre is empty

查看:94
本文介绍了在数据源为空时显示gridview的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法显示GridView控件的列标题,即使

解决方案

如果使用的是.Net Framework 4.0,请设置ShowHeaderWhenEmpty [一种更优雅的解决方案,用于在数据源为空时显示GridView页眉和页脚 [ ^ ]

希望这对您有帮助!


s ...您可以在gridview中使用模板字段,以便您可以查看网格的标题,即使它是空的


Is there a way to show the column headers of a GridView control even if
there is no data?

解决方案

If you are using .Net framework 4.0, set ShowHeaderWhenEmpty[^] property of the GridView to True. That''s all required to show the header even if the datasource is empty.

For other versions, checkout this blog post - A more elegant solution to display GridView header and footer when the data source is empty[^]

Hope this helps!


s...you can use template field in your gridview so that u can view your headers of grid even it is empty


这篇关于在数据源为空时显示gridview的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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