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

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园_首页
M
MIT News - Artificial intelligence
月光博客
月光博客
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
Vercel News
Vercel News
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
The Register - Security
The Register - Security
B
Blog
Recorded Future
Recorded Future
J
Java Code Geeks
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
F
Fortinet All Blogs
B
Blog RSS Feed
Project Zero
Project Zero
The Hacker News
The Hacker News
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
Jina AI
Jina AI
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
G
Google Developers Blog
GbyAI
GbyAI
S
Securelist
T
Tenable Blog
博客园 - 【当耐特】
Security Latest
Security Latest
人人都是产品经理
人人都是产品经理
T
Tor Project blog
Latest news
Latest news
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss

博客园 - 黄永泰

extern修饰符的使用(C#) .NET Framework 4与.NET Framework 4 Client Profile 的区别? 《C#与.NET 4高级程序设计:第5版》这本书如何? *.docx文件打开方法 试图运行项目时出错,无法启动调试。没有正确安装调试器,请运行安装程序安装或恢复调试器。 System.ArgumentException: 另一个SqlParameterCollection中已包含SqlParameter。 买了几本书。 给Visual Studio 2010换皮肤。 请教一个程序自动升级的写法. 支持掘金,支持"甜瓜"安东尼. NBA 2009-10赛季赛程表 IList<T>、List<T>、BindingList<T>与dataGridView的绑定问题(请教)。 近期及今后一段时间的学习目标. 数据库从Sql server 2000升级到2005后,遇到一点问题。 请教: sql server 中动态创建命令语句 大家继续努力! 近期.net学习计划。 谢谢大家的指教! 关于“我的藏书阁:.NET/数据库应用开发”的几点看法。
IList<T>、List<T>、BindingList<T>与dataGridView的绑定问题。
黄永泰 · 2009-06-06 · via 博客园 - 黄永泰

当在业务层BLL返回IList<T>或者List<T>集合,绑定到dataGridView控件后,dataGridView控件不能删除一行,也不能在末端新增一行,真的奇怪。但用BindingList<T>就可以了,所以遇到这种需要删除、新增操作时,可以在UI中把把业务层的IList<T>转换成BindingList<T>,如:

        IList<Code> codeList = new List<Code>();
        dataGridViewCodeList.DataSource = codeList;//dataGridView的行不能增删
        dataGridViewCodeList.DataSource = 
            new BindingList<Code>(codeList);//转换为BindingList<T>后可以增删

BindingList<T>和List<T>可以相互转换的道理说明可以参照:http://www.cnblogs.com/sunrack/articles/1142085.html