Edit this page

Empty Cells in Combobox column


When you use the GridViewComboBoxColumn you might encounter empty cells in that column:

GridView Troubleshooting Blank Cells


First you need to check:

  • The Output for Binding exceptions

  • If the types are of the same type

If you do not encounter any of the above mentioned problems, then you probably use ElementName binding for that column, e.g.

[XAML] Example 1: Binding with ElementName

<telerik:GridViewComboBoxColumn Header="Category"
DataMemberBinding="{Binding CategoryID}"
ItemsSource="{Binding Path=DataContext.Categories, ElementName=RootElement}"
SelectedValueMemberPath="CategoryID" />

This will not work, as the DataContext of the cell would not be the ViewModel, but the business object related to the row instead. We do not recommend such approach.


There are two ways of solving the issue :

Setting the ItemsSource of GridViewComboBoxColumn

  • Expose the ViewModel as a static resource on the page so that it can be easily accessible by the binding:

[XAML] Example 2: Exposing the ViewModel as a Static Resource

    <local:MyViewModel x:Key="MyViewModel" />
  • Set the ItemsSource of the ComboBox column:

[XAML] Example 3: Setting the ItemsSource of GridViewComboBox declaratively

<telerik:GridViewComboBoxColumn Header="Category"
DataMemberBinding="{Binding CategoryID}"
ItemsSource="{Binding Path=Categories, Source={StaticResource MyViewModel}}"
SelectedValueMemberPath="CategoryID" />

[C#] Example 4: Setting the ItemsSource of GridViewComboBoxColumn programmatically

private void gridView_DataLoaded(object sender, EventArgs e)
    (this.radGridView.Columns["Category"] as GridViewComboBoxColumn).ItemsSource = GetCategories();

[VB.NET] Example 4: Setting the ItemsSource of GridViewComboBoxColumn programmatically

Private Sub gridView_DataLoaded(ByVal sender As Object, ByVal e As EventArgs)
    TryCast(Me.radGridView.Columns("Category"), GridViewComboBoxColumn).ItemsSource = GetCategories()
End Sub

Setting the IsLightWeightModeEnabled property

As of R2 2016 GridViewComboBoxColumn exposes the IsLightWeightModeEnabled. When set to True, a completely new lookup logic is used which improves the performance of the column and could be a solution for a scenario when having empty cells in it. More information can be found in the ComboBoxColumn topic.

See also