views:

19

answers:

1

Is it possible to have a file/directory selection button next to a property value in the PropertyGrid? Hitting the button would launch a standard "Open File" or "Select Directory" type of dialog. In a perfect world, this could be done using an Attribute on the SelectedObject's property.

+2  A: 

Yes, add this attribute to the property.

[EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))]
Gary
Exactly what I was looking for. Thanks a lot! For others looking for the second part of the answer: For a folder browser dialog just replace FileNameEditor with FolderNameEditor.
Matthias