PropertyGrid - Possible to have a file/directory selection button next to a property value?
Asked Answered
P

1

9

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.

Paramo answered 7/9, 2010 at 6:51 Comment(0)
N
15

Yes, add this attribute to the property.

[EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))]
Newfoundland answered 7/9, 2010 at 7:1 Comment(2)
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.Paramo
Don't forget to reference System.Design.dllShetrit

© 2022 - 2024 — McMap. All rights reserved.