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.
PropertyGrid - Possible to have a file/directory selection button next to a property value?
Asked Answered
Yes, add this attribute to the property.
[EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))]
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.dll –
Shetrit
© 2022 - 2024 — McMap. All rights reserved.