I’ve been having some issues with the propertygrid. Namely:
The behavior is not the same when i’m using a the propertygrid in the visual studio designer, versus at runtime, also while debugging.
A few to note (this is using a form in the designer, and editing a custom textbox, versus embedding a propertygrid into a form, and attaching it to the same custom textbox)
When I have multiple object selected in the designer, and I set a property (custom type, with converter) I’m getting a null reference exception. When I used the ‘SelectedObjects’ field at runtime, I don’t get the exception. If I attach the debugger to the designer, the exception will not happen, and my property setting will work correctly.
I implemented my own expandableobject converter that does property ordering. My properties show up in the correct order when I’m running my application, but they still show up in the default order when using the visual studio designer.
Is there any resources out there that can help explain why these behaviors are happening?
Thanks!
Are you referencing any classes outside of the current assembly (or outside the solution even more-so)?
The designer is not nearly as good as loading those external dll’s. There are situations where the designer will know that you’re deriving from ExpandableObjectConverter, but cannot load your specific base class, and in the end, it just loads the generic converter. Try loading all of your bases classes into the current assembly and see if that makes a difference.