Hi,
I have a PropertyGrid that edits an object that has an int property that represents a foreign key to a particular list of objects.
Let's say for example that the objects referenced by this foreign key have this type:
class Article
{
public int ID {get; set;}
public string Code {get; set;}
}
Let also say that I have a repository that returns the list of all articles:
IEnumerable<Article> Articles
{
get;
}
Suppose the object passed to the ProperyGrid has a property like this:
int ArticleID {get; set;}
How is it possibile to change the default behaviour of PropertyGrid on property named "ArticledID"?
I don't want, in fact, an integer textbox edit, but instead I'd like to a have a ComboBox populated by "Articles" repository property, showing the "Code" property as Display property but using the "ID" property as Value property.
Thank you in advance.
Silvio