开发者

PropertyGrid: Merging multiple dynamic properties when editing multiple objects

开发者 https://www.devze.com 2022-12-25 07:02 出处:网络
Let\'s say I have a class A and a class B. I would like to edit using .NET PropertyGrid multiple instances of A and B simultaneously. The desired behavior would be to have the intersection of properti

Let's say I have a class A and a class B. I would like to edit using .NET PropertyGrid multiple instances of A and B simultaneously. The desired behavior would be to have the intersection of properties displayed.

If A and B have static (written in the source code) properties everything works fine. Selecting A and B instances will only display the intersection of properties.

However, if A and B also have dynamic properties (returned as a PropertyDescriptorCollection through the GetPr开发者_如何学运维operties() method) the behavior is wrong. When selecting multiple objects I will only see those static properties and none of the dynamic ones.

When I select only one instance I can see all properties (static and dynamic).

Anybody any ideas? I couldn't find anything on the internet.


Are you using the MergablePropertyAttribute on the properties?

0

精彩评论

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

关注公众号