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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News | PayPal Newsroom
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
Forbes - Security
Forbes - Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
Hacker News: Ask HN
Hacker News: Ask HN
H
Heimdal Security Blog
D
Docker
Cloudbric
Cloudbric
P
Privacy International News Feed
S
Security Affairs
TaoSecurity Blog
TaoSecurity Blog
博客园 - 聂微东
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tenable Blog
Scott Helme
Scott Helme
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
P
Palo Alto Networks Blog
小众软件
小众软件
L
LINUX DO - 最新话题
美团技术团队
Google Online Security Blog
Google Online Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
The Hacker News
The Hacker News
Webroot Blog
Webroot Blog
T
Tor Project blog
G
Google Developers Blog
A
About on SuperTechFans
Y
Y Combinator Blog
K
Kaspersky official blog
A
Arctic Wolf
量子位
I
InfoQ
V
Visual Studio Blog
T
Troy Hunt's Blog
C
Cybersecurity and Infrastructure Security Agency CISA
J
Java Code Geeks
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - 水冰月

不要认为停留在心灵的舒适区域 成功不需要时间 只要你坚持 淘宝 世界名校的课件[转校内] 标题 javascript操作Select标记中options集合 七个受用一生的心理寓言 一辈子都有用的的75句话 完美的自己 一生中无能为力的10件事 xsd验证xml 浅谈asp.net2.0验证控件的安全使用 Javascript脚本和asp.net验证控件同时验证的代码 远程桌面“中断”巧解决 收集一些.NET开发资源站点和部分优秀.NET开源项目 XP实用技巧:恢复"显示桌面"按钮 在IE7.0中如何设置代理 Win 2003 Server重新安装Oracle9i 在windows xp环境下如何完全卸载 oracle9i
当DataSet为空时也显示GridView的表头(vs05) - 水冰月 - 博客园
水冰月 · 2008-04-25 · via 博客园 - 水冰月

/// <summary>
/// 当DataSet为空时也显示GridView的表头
/// </summary>
/// <param name="gridView">所要绑定的GridView</param>
/// <param name="ds">所要绑定的数据集</param>
/// <returns>void </returns>

public void BindNoRecords(GridView gridView, DataSet ds)
{
     
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 = "没有数据";
          gridView.RowStyle.HorizontalAlign
= System.Web.UI.WebControls.HorizontalAlign.Center;
     }

}
  

posted on 2008-04-25 18:19  水冰月  阅读(611)  评论(0)    收藏  举报