DataGridView数据绑定任意对象的数组
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DataGridView数据绑定任意对象的数组相关的知识,希望对你有一定的参考价值。
Stupidly simple -- just one pitfall: class to be bound must have Get/Set methods for reflection to discover. Which is annoying when it comes to client side classes auto generated from WSDL.
DataGridView1.DataSource = foos; //This works. public class FooGood { public string Bar { get; set; } public string Baz { get; set; } } //This Doesn't public class FooBad { public string Bar; public string Baz; }
以上是关于DataGridView数据绑定任意对象的数组的主要内容,如果未能解决你的问题,请参考以下文章