views:

8

answers:

1

So i have a combobox as the CellEditingTemplate of a datagrid and selected item is bound to the datacontext of that row as expected, but i need the combobox to be populated from a ObservableCollection outside of the context of the datagrid from the ViewModel.

How could i acheive this?

Thanks

+1  A: 

In this case the most likely scenario is to specify a Source for your binding on the ComboBox.

<Grid.Resources>
   <local:SomeTypeThatHasAEnumerableProperty x:Key="HolderOfEnumerable" />
</Grid.Resources>
...
<ComboBox ItemsSource="{Binding EnumerableProperty, Source={StaticResource HolderOfEnumerable}}" ....>
AnthonyWJones