`TelerikControls` has a bug and sometimes the `GridView` displays empty `ComboBoxCells`. In order to fix this I followed their steps here http://docs.telerik.com/devtools/wpf/controls/radgridview/troubleshooting/blank-cells.html and I have to point the `ItemsSource` to a static resource.
That method works perfectly if the resource never changes, but mine can change depending on a `ComboBoxSelection` within the `DataGrid`. I'm wondering how do I update my `StaticResource` collection in the UI.
I've tried this method http://stackoverflow.com/questions/4438876/wpf-refresh-staticresource but it never changed the collection in the UI.
**RelationshipEditor.xaml.cs**
**RelationshipEditor.xaml**
I've set break points for `GridRelationshipTypes` and I can see it is getting the correct collection. If I remove static resource, the code works perfectly but it may still exhibit the telerik bug.
That method works perfectly if the resource never changes, but mine can change depending on a `ComboBoxSelection` within the `DataGrid`. I'm wondering how do I update my `StaticResource` collection in the UI.
I've tried this method http://stackoverflow.com/questions/4438876/wpf-refresh-staticresource but it never changed the collection in the UI.
**RelationshipEditor.xaml.cs**
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var radcomboBox = e.OriginalSource as RadComboBox;
if (radcomboBox != null)
{
RadComboBox comboBox = (RadComboBox)e.OriginalSource;
(FindResource("MyChannelDataProvider") as ObjectDataProvider).Refresh();
}
}`
**RelationshipEditor.xaml**
<
ObjectDataProvider
x:Key
=
"MyChannelDataProvider"
ObjectType
=
"{x:Type Loans:LoanViewModel}"
>
</
ObjectDataProvider
>
<
Telerik:GridViewComboBoxColumn
Header
=
"Relationship"
ItemsSource
=
"{Binding SelectedRelationship.GridRelationshipTypes, Source={StaticResource MyChannelDataProvider}}"
DataMemberBinding
=
"{Binding RelationshipType}"
SelectedValueMemberPath
=
"Id"
DisplayMemberPath
=
"Name"
>
</
Telerik:GridViewComboBoxColumn
>
I've set break points for `GridRelationshipTypes` and I can see it is getting the correct collection. If I remove static resource, the code works perfectly but it may still exhibit the telerik bug.