I have a List<> (my custom class). I want to display a specific item in this list in a box on the PropertyGrid control. At the end of the box I would like the […] button. When clicked, it would open up a form which, among other things, would allow them to pick one of the items from the List. When closed, the PropertyGrid would be updated to reflect the selected value.
Any help appreciated.
You need to implement a modal
UITypeEditor, using theIWindowsFormsEditorServiceservice to display it:Note: if you need to access something about the context of the property (the parent object etc), that is what the
ITypeDescriptorContext(inEditValue) provides; it tells you thePropertyDescriptorandInstance(theMyType) that is involved.