Articles in this section
Category / Section

How to bind SelectedValue for the SfComboBox within the SfDataGrid?

1 min read

In SfComboBox, you can bind the SelectedValue property of the SfComboBox. When SfComboBox is used as a template for the SfDataGrid column, set the SelectedValue in a separate SfComboBox. You can also set the SelectedValue for each SfComboBox in the SfDataGrid in a loaded event. This can be achieved in the following code.


<syncfusion:GridTemplateColumn MappingName="ShipCountry">
                            <editors:SfComboBox x:Name="Combo" Loaded="Combo_Loaded"/>



private void Combo_Loaded(object sender, RoutedEventArgs e)
            SfComboBox combobox = sender as SfComboBox;
                combobox.ItemsSource = new ShipCountries();
                combobox.SetBinding(SfComboBox.SelectedValueProperty, sfdatagrid.Columns["ShipCountry"].DisplayBinding);

Figure 1: SelectedValues are binded to the SfComboBox

Figure 2: SfComboBox dropdown is opened

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Please sign in to leave a comment