When I have a property with a custom type which has a type converter attribute, the property grid only shows the type name of the property, not the value provided by the type converter. Binding the same property to a TextBox lets me edit the proper converted type.
```
class Sample
{
public StringDictionary StringMapping
{
get
{
return _stringMapping;
}
set
{
if (_stringMapping == value)
return;
_stringMapping = value;
OnPropertyChanged();
}
}
}
[TypeConverter(typeof(StringDictionaryConverter))]
[Serializable]
public class StringDictionary : Dictionary<string, string>
{
public StringDictionary()
{
}
protected StringDictionary(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
public class StringDictionaryConverter : SimpleDictionaryConverter<string, string, StringDictionary>
{
// convert dict to "key1=value1 key2=value2 ..." and vice versa
}
```
A text box will let me edit the values, while the property grid only shows "somenamespace.StringDictionary"
Comments: ** Comment from web user: fitidnc **
```
class Sample
{
public StringDictionary StringMapping
{
get
{
return _stringMapping;
}
set
{
if (_stringMapping == value)
return;
_stringMapping = value;
OnPropertyChanged();
}
}
}
[TypeConverter(typeof(StringDictionaryConverter))]
[Serializable]
public class StringDictionary : Dictionary<string, string>
{
public StringDictionary()
{
}
protected StringDictionary(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
public class StringDictionaryConverter : SimpleDictionaryConverter<string, string, StringDictionary>
{
// convert dict to "key1=value1 key2=value2 ..." and vice versa
}
```
A text box will let me edit the values, while the property grid only shows "somenamespace.StringDictionary"
Comments: ** Comment from web user: fitidnc **
To simplify what I am asking for check out the following link in your documentation
http://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid#expandable_properties
In the image of property grid, notice that the text displayed next to "Spouse" says
Samples.Modules.PropertyGrid.Views.ExpandableProp
That doesn't look good when you are exposing a propertygrid to customers. How can I customize what I diplay there.