views:

225

answers:

1

Hi,

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 GetProperties() 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.

A: 

Are you using the MergablePropertyAttribute on the properties?

eschneider
Yes i've tried that but it didn't work.I also tried replicating the list of attributes of static properties but that didn't work either (note that the static properties didn't even have the mergeable attribute set).
Andrei Stanescu