开发者

DataGridView ICustomTypeDescriptor

开发者 https://www.devze.com 2023-04-07 07:07 出处:网络
I´m want build a DataGridView with Databinding to a Class where I can add Properties at Runtime. I want to add Columns at runtime and have the values stored in the class.

I´m want build a DataGridView with Databinding to a Class where I can add Properties at Runtime. I want to add Columns at runtime and have the values stored in the class. I found a nice example here (Dictionary to store Properties with ICustomTypeDescriptor)

It works fine til i want read information from the DataGridView. I get NullReferenzException or IndexOutOfBoundException.

I think something is missing in my BindingClass with the ICustomTypeDescriptor. The .NET designer don´t create C开发者_开发知识库olumns in Visual Studio but therea are created at programmstart.

I will be realy glad, if someone could help me with this one.


I don't know the answer, but I suggest checking the column management. Maybe you have forgotten for example assigning the Name or DataPropertyName properties of the column...

Please give more description of your problem + some code.

0

精彩评论

暂无评论...
验证码 换一张
取 消