gridview标题问题 [英] gridview header problem

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

问题描述

我有一个带有sqldatasource的gridview,并且我有一个搜索文本框,如果未从文本框中找到结果,我需要显示带有标题的空gridview且没有找到记录的文本,该怎么做呢?

i have a gridview with sqldatasource and i have a search text box if no result found from the text box i need to show empty gridview with headers and no records found text also how to do that

推荐答案

在绑定之前向数据集添加一个空行
add an empty row to the dataaset before binding


您可以将所需的任何内容放入gridview
emptydatatemplate中 例如,在您的情况下,将表格标题和一条消息添加到gridview的emptydatatemplate :

在这里查看示例:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx [
You can put anything you want in emptydatatemplate of a gridview
for example in your case add table header and a message to emptydatatemplate of your gridview :

See an example here :
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx[^]


这篇关于gridview标题问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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