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 bind different ItemsSources to each row of the ComboBox by using GridTemplateColumn in the SfDataGrid?

In the SfDataGrid, by default the ComboBox is loaded while editing the cell values of the GridComboBoxColumn. It lists out the initially populated values that are bound to the ItemsSource property of the GridComboBoxColumn. The same ItemsSource is loaded to each cell of the GridComboBoxColumn. Since the ItemsSource is a single instance of the GridComboBoxColumn, you cannot load different ItemsSources to each cell while editing it.

To overcome this, you can use the GridTemplateColumn to create your own cell types. By specifying the CellTemplate and EditTemplate, you can customize the content in both displays and edit with the GridTemplateColumn. You can load any control in both Cell Template and Edit Template of the GridTemplateColumn.

Similarly, you can load the ComboBox in EditTemplate of the GridTemplateColumn and it creates a new ComboBox instance while editing the GridCell. Here, you can bind different ItemsSources to each row of the ComboBox as illustrated in following code example.


The ItemsSource for each row of the ComboBox is set based on the Country Name with the help of converter as illustrated in the following code example.


The following screenshot illustrates the different ShipCity ItemsSources bound to each row of the ComboBox based on the Country Name in the GridTemplateColumn.

Figure 1: ShipCity list of Argentina

Figure 2: Ship city list of Brazil

Sample Links:




Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
6069 01/22/2016 01/22/2016 UWP SfDataGrid 4.5.1
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to 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