C# Winforms: PropertyGrid not updated when item added to Collection

Posted by MysticEarth on Stack Overflow See other posts from Stack Overflow or by MysticEarth
Published on 2010-06-10T12:24:59Z Indexed on 2010/06/10 12:52 UTC
Read the original article Hit count: 545

Filed under:
|
|

I've got a custom class which can be edited through the PropertyGrid. In that class I've got a custom Collection (with custom PropertyDescriptor and TypeConverter).

Items can be added to or removed from the Collection with the default Collection Editor. This all works fine. But - after closing the Collection Editor, the PropertyGrid is not updated. When I manual make a call to Refresh() on the PropertyGrid, the changes are reflected in the PropertyGrid.

How can I get the PropertyGrid to automatically refresh when the Collection Editor has been closed? I sought for a solution earlier where I should subclass CollectionEditor (which I can't seem to find).

Please help.

© Stack Overflow or respective owner

Related posts about c#

Related posts about collections