Hi All,
I am using WPF PropertyGrid (http://www.codeplex.com/wpg) in my project. But i have some problems with this component.
1) I can show my IList collections in a ComboBox. But i can't retrieve selected value. How can i get selected value?
2) Enums are automatically shown in combobox, but i can't retrieve selected value like #1.
Can you help me?
This is my collection property
public class Contact {
// Other properties
[TypeConverter(typeof(MyConverter))]
public string Cities
{
get;
set;
}
}
This is my converter class
class MyConverter : TypeConverter
{
public override bool
GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
List<string> list = new List<string>();
list.Add("Istanbul");
list.Add("Ankara");
list.Add("Izmir");
StandardValuesCollection cols = new
StandardValuesCollection(list);
return cols;
}
}
When i set my Contact class's instance to WPF PropertyGrid's Instance property, i couldn't see any combox. But if i set my object to .Net PropertyGrid i can see this solution works well.
So i think this PG doesn't support TypeConverts, so what can i do?