惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Hacker News
The Hacker News
F
Full Disclosure
有赞技术团队
有赞技术团队
H
Help Net Security
Security Latest
Security Latest
P
Palo Alto Networks Blog
MyScale Blog
MyScale Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
P
Privacy International News Feed
P
Proofpoint News Feed
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
罗磊的独立博客
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Latest news
Latest news
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Hacker News: Ask HN
Hacker News: Ask HN
爱范儿
爱范儿
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
The Last Watchdog
The Last Watchdog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
L
LINUX DO - 热门话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
L
Lohrmann on Cybersecurity
O
OpenAI News
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - kary

VS 2005 Web Deployment Projects Web Deployment Projects with Visual Studio 2005 asp.net2.0如何加密数据库联接字符串 - kary - 博客园 快速排序与二分查找算法Javascript版本 - kary - 博客园 随页面移动的浮动广告代码 - kary - 博客园 MSDN转:自定义实体类简介 aspnet2.0 Menu控件上传到服务器小问题 ASP.NET2.0的快速入门站点 AJAX开发简略 用人之道(二)-- 何管理软件开发团队 转:用人之道(一)-- 如何组建软件开发队伍 袁峰写的开发之路 雅虎公司C#笔试题 转:产品开发模式管理网站开发 Windows IIS 6安全保护贴—URL授权全攻略! Access库的小问题 要做互联星空的SP接口,一点头绪都没有 windows server 2003 出错提示"请求的资源在使用中"解决方案 针对SQL INJECTION的SQL SERVER安全设置初级篇
GridView绑定数据源,无记录时表头也显示的一种解决方法
kary · 2006-06-06 · via 博客园 - kary

转:Show Header/Footer of Gridview with Empty Data Source
public void BuildNoRecords(GridView gridView, DataSet ds)
{
try {
if (ds.Tables(0).Rows.Count == 0) {
ds.Tables(0).Rows.Add(ds.Tables(0).NewRow());
gridView.DataSource = ds;
gridView.DataBind();
int columnCount = gridView.Rows(0).Cells.Count;
gridView.Rows(0).Cells.Clear();
gridView.Rows(0).Cells.Add(new TableCell());
gridView.Rows(0).Cells(0).ColumnSpan = columnCount;
gridView.Rows(0).Cells(0).Text = "No Records Found.";
}
} catch (Exception ex) {
}

posted on 2006-06-06 08:58  kary  阅读(952)  评论()    收藏  举报