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

推荐订阅源

Forbes - Security
Forbes - Security
A
Arctic Wolf
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
A
About on SuperTechFans
P
Palo Alto Networks Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
大猫的无限游戏
大猫的无限游戏
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
T
Tor Project blog
IT之家
IT之家
P
Proofpoint News Feed
Help Net Security
Help Net Security
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
N
News and Events Feed by Topic
The Cloudflare Blog
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
The Last Watchdog
The Last Watchdog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LangChain Blog
I
InfoQ
F
Full Disclosure
The Register - Security
The Register - Security
阮一峰的网络日志
阮一峰的网络日志
H
Hacker News: Front Page
V
V2EX

博客园 - jeff377

使用 Sandcastle Help File Builder 制作 VS.NET 的 HELP 文件 [ASP.NET 控件实作 Day31] TBContextMenu 控件三种不同模式的 Click 动作 [ASP.NET 控件实作 Day30] 整合 jQuery ContextMenu plugin 的右键选单控件 [ASP.NET 控件实作 Day29] 解决 DropDownList 成员 Value 值相同产生的问题 [ASP.NET 控件实作 Day28] 图形验证码控件 [ASP.NET 控件实作 Day27] 控件依 FormView CurrentMode 自行设定状态 [ASP.NET 控件实作 Day25] 自订 GridView 字段 - 日期字段 [ASP.NET 控件实作 Day24] TBDropDownField 的 Items 属性的数据系结 [ASP.NET 控件实作 Day23] 自订 GridVie 字段类别 - 实作 TBDropDownField 字段类别 [ASP.NET 控件实作 Day22] 让 DropDownList 不再因项目清单不存在而造成错误 [ASP.NET 控件实作 Day21] 实作控件智能卷标 [ASP.NET 控件实作 Day20] 侦错设计阶段的程序代码 [ASP.NET 控件实作 Day19] 控件设计阶段的外观 [ASP.NET 控件实作 Day18] 修改集合属性编辑器 [ASP.NET 控件实作 Day17] 集合属性包含不同型别的成员 [ASP.NET 控件实作 Day16] 继承 WebControl 实作 Toolbar 控件 [ASP.NET 控件实作 Day15] 复合控件隐藏的问题 [ASP.NET 控件实作 Day14] 继承 CompositeControl 实作 Toolbar 控件 [ASP.NET 控件实作 Day13] Flash 控件
[ASP.NET 控件实作 Day26] 让你的 GridView 与众不同
jeff377 · 2008-10-28 · via 博客园 - jeff377

在网络上可以找到相当多扩展 GridView 控件功能的文章,在笔者的部落格中也有多篇提及扩展 GridView、DataControlField、BoundFIeld 功能的相关文章,在本文将这些关于扩展 GridView 控件功能及字段类别的相关文章做一整理简介,若需要扩展 GridView 相关功能时可以做为参考。

1. 扩展 GridView 控件 - 无数据时显示标题列

摘要:当 GridView 系结的 DataSource 资料笔数为 0 时,会依 EmptyDataTemplate 及 EmptyDataText 的设定来显示无数据的状态。若我们希望 GridView 在无数据时,可以显示字段标题,有一种作法是在 EmptyDataTemplate 中手动在设定一个标题列,不过这种作法很麻烦。本文扩展 GridView 控件,直接透过属性设定就可以在无数据显示字段标题。

2. 扩展 GridView 控件 - 支持 Excel 及 Word 汇出

摘要:GridView 汇出 Excel 及 Word 文件是蛮常使用的需求,此篇文章将扩展 GridView 控件提供汇出 Excel 及 Word 文件的方法。一般在 GridView 汇出的常见下列问题也会在此一并被解决。

3. GridView+FormView 示范数据 新增/修改/删除(进阶篇:服务器控件)

摘要:扩展 GridView 及 FormView 控件,在 GridView 控件中新增 FormViewID 属性,关连至指定的 FormView 控件 ID,就可以让 GridView 结合 FormView 来做数据异动的动作。

4. 扩展 CommandField 类别 - 删除提示讯息

摘要:新增 DeleteConfirmMessage 属性,设定删除提示确认讯息。

5. 扩展 CommandField 类别 - 删除提示讯息含字段值

摘要:设定删除提示确认讯息中可包含指定 DataField 字段值,明确提示要删除的数据列。

6. 让 CheckBoxField 系结非布尔值(0 或 1)字段

摘要:CheckBoxField 若系结的字段值为 0 或 1 时 (非布尔值) 会发生错误,本文扩展 CheckBoxField 类别,让 CheckBoxField 有辨法系结 0 或 1 的字段值。

7. 扩展 CheckBoxField 类别 - 支持非布尔值的双向系结

摘要:CheckBoxField 系结的字段值并无法直接使用 CBool 转型为布尔值,例如 "T/F"、"是/否" 之类的资料,若希望使用 CheckBoxField 来显示就比较麻烦,一般的作法都是转为 TemplateField,自行撰写数据系结的函式,而且只能支持单向系结。在本文直接改写 CheckBoxField 类别,让 CheckBoxField 可以直接双向系结 "T/F" 或 "是/否" 之类的资料。

8. 扩展 CommandField 类别 - Header 加入新增钮

摘要:支持在 CommandField 的 Header 的部分加入「新增」钮,执行新增钮会引发 RowCommand 事件。

9. GridView 自动编号字段 - TBSerialNumberField

摘要:继承 DataControlField 来撰写自动编号字段,若 GridView 需要自动编号字段时只需加入字段即可。

10. 自订 GridVie 字段类别 - 实作 TBDropDownField 字段类别

摘要:支持在 GridView 中显示下拉列表的字段类别。

11. 自订 GridView 字段 - 日期字段

摘要:支持在 GridView 中显示日期下拉选单编辑的字段类别。

备注:本文同步发布于「第一届iT邦帮忙铁人赛」,如果你觉得这篇文章对您有帮助,记得连上去推鉴此文增加人气 ^^
http://ithelp.ithome.com.tw/question/10013209