"create a grid that shows the string value of the properties of an object (using the reflection API to iterate over the object's public properties). The next step is creating custom editors for the types that need them (like a true/false drop-down for booleans, or a drop down that shows all the values for an Enum, a DTP for DateTime values, a color picker for colors, etc., etc). Finally you want to call any custom editors a user might provide for his or her own types (by checking for an EditorAttribute on the Property and then the Type)."
DataTemplates in Action: Building a simple PropertyGrid, WPF PropertyGrid - MVVM techniques, and WPF Property Grid.
it also have code to select DataTemplate depend on DataType of each class property: bool use BooleanDataTemplate which is a checkbox; Enum use EnumDataTemplate which is a combobox.
I also like go a little further, add custom type: lookup, which will show as dropdown list, but the value list come from database. e.g.
property name: car manufacturere, value come from "SELECT LOOKUP_VALUE FROM LOOKUP WHERE LOOKUP_KEY = 'CAR_MFG'", which will return a list like: Toyota, Ford, Nissan, Honda, VW, BMW, ...
If I have > 1 lookup properties, how I can speciafy them? LookupDataTemplate1, LookupDataTemplate2, ..., then how to specify them in XAML Resources. and all DataTemplate are pre-defined in XAML, how I can do it in this case.
similar to EnumToListConverter, How I can create LookupmToListConverter1, LookupmToListConverter2?
Post question at stackoverflow and MSDN Forum .