Hello,
I am evaluating the PropertyGrid control and have a question about setting custom edtitors through the EditorAttribute on a data class.
I have a standard .NET class with a series of properties. Instances of this class get set to the PropertyGrid.SelectedObject. In the example below I am trying to use the DialogTextBoxPropertyEditor to provide a larger textbox for editing the notes field, but when the PropertyGrid is displayed the button to open the dialog is disabled. How do I get this editor to work. Also are there some good examples of how to create my own custom editors which can be associated to properties using the EditorAttribute. Thanks.
I am evaluating the PropertyGrid control and have a question about setting custom edtitors through the EditorAttribute on a data class.
I have a standard .NET class with a series of properties. Instances of this class get set to the PropertyGrid.SelectedObject. In the example below I am trying to use the DialogTextBoxPropertyEditor to provide a larger textbox for editing the notes field, but when the PropertyGrid is displayed the button to open the dialog is disabled. How do I get this editor to work. Also are there some good examples of how to create my own custom editors which can be associated to properties using the EditorAttribute. Thanks.
public class DataClass
{
[Description("Notes")]
[Category("Definition")]
[Editor(typeof(PropertyEditors.DialogTextBoxPropertyEditor), typeof(PropertyEditors.PropertyEditor))]
public string Notes
{
get { return _notes; }
set { _notes = value; RaisePropertyChanged(() => Notes); }
}
}