I have a class for PropertyGrid.SelectedObject property. It has a property defined like this:
[DisplayName("Thickness")]
[ItemsSource(typeof(ThicknessItemsSource))]
public string Thickness { get; set; }
public class ThicknessItemsSource : IItemsSource
{
public ItemCollection GetValues()
{
ItemCollection collection = new ItemCollection();
foreach (var v in ...)
{
collection.Add(v);
}
return collection;
}
}
I need to use a custom editor for this property - and it should be a custom TextBox editor, not ComboBox. The problem is that, if 'ItemsSource' attribute is defined - it ignores my textbox editor and shows a combobox. So I have two questions: Is it possible to have a custom editor with a TextBox for this property? Can this editor/textbox access items returned by ItemsSource attribute?
... my custom editor is applied like this:
<toolkitExt:PropertyGrid.EditorDefinitions>
<toolkitExt:EditorTemplateDefinition TargetProperties="Thickness">
<toolkitExt:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<cc:TextBoxEditor/>
</DataTemplate>
</toolkitExt:EditorTemplateDefinition.EditingTemplate>
</toolkitExt:EditorTemplateDefinition>
</toolkitExt:PropertyGrid.EditorDefinitions>
↧