
I am fairly new to using this toolkit so forgive me if this is a silly question, but I cannot seem to figure out how to get a custom editor into my application via code. I am writing a form designer and the property grid will have dozens of different types of data in its 'SelectedItems' collection so I am making heavy use of the [Editor] attribute. Most are working fine, but one class has a Filename (string) property and I would like it to be read-only and need an ellipsis button that fires an OpenFileDialog when clicked. I have inherrited from the DialogTextBoxPropertyEditor:
I have assigned the editor to my Filename property:
And when the property is displayed I do get the ellipsis button but it is disabled. I would have expected perhaps an event or an override on the DialogTextBoxPropertyEditor class that I could respond to or override but that doesn't seem to be how it is done. Are there any examples anywhere of this type of implementation?
Thanks!
public class FilenameEditor : DialogTextBoxPropertyEditor
{
public FilenameEditor()
{
}
}
[Editor(typeof(FilenameEditor), typeof(PropertyEditor))]
public string Filename
{
get { return _filename; }
set { _filename = value; }
}
Thanks!