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

推荐订阅源

腾讯CDC
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
月光博客
月光博客
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
WordPress大学
WordPress大学
Jina AI
Jina AI
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
I
InfoQ
Vercel News
Vercel News
C
Check Point Blog
美团技术团队
V
V2EX
量子位
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
G
Google Developers Blog
博客园_首页
J
Java Code Geeks
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
H
Help Net Security
博客园 - Franky
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
T
Tailwind CSS Blog
IT之家
IT之家
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
L
LangChain Blog
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 黄永泰

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