We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to insert a combobox CustomEditor for a property that is a foreign key ID

Thread ID:





125555 Aug 24,2016 03:48 PM UTC Aug 25,2016 11:06 AM UTC WPF 1
Tags: PropertyGrid
Asked On August 24, 2016 03:48 PM UTC


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

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.


Vinothini [Syncfusion]
Replied On August 25, 2016 11:06 AM UTC

Hi Silvio, 

Thank you for contacting Syncfusion support. 

The ComboBox can be added to the Property grid using the CustomEditorCollection property. We need to implement a Custom editor with ITypeInterface. Please refer the code example for adding ComboBox in ArticleID property. 


pgrid.SelectedObject = new Article(); 
CustomEditor editor = new CustomEditor(); 
editor.Editor = new ComboEditor(); 

We have prepared sample for the sample which is available in the below location. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon