Problem z wiązaniem DataGridComboBoxColumn.ItemsSource
Mam 3 tabele: Item - czyli DataContext - ma kolumnę nawigacyjną Group Group - ma kolumnę nawigacyjną Category.
Chcę mieć w kolumnach DataGrid zarówno (kategorię i grupę), a kiedy wybieram kategorię, powinna ona wyświetlać w grupie col tylko Category.Groups.
Oto kod, nad którym pracuję:
<tk:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}">
<tk:DataGrid.Columns>
<!--Works-->
<tk:DataGridComboBoxColumn
Header="Categroy"
DisplayMemberPath="Title"
SelectedValuePath="CategoryId"
SelectedValueBinding="{Binding Group.Category.CategoryId}"
ItemsSource="{Binding Context.Categories,
Source={x:Static Application.Current}}"
/>
<!--Look at these two things:-->
<!--This does work-->
<tk:DataGridTemplateColumn>
<tk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ItemsControl
ItemsSource="{Binding Group.Category.Groups}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type data:Group}">
<TextBlock Text="{Binding Title}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</tk:DataGridTemplateColumn.CellTemplate>
</tk:DataGridTemplateColumn>
<!--But this does NOT work, even it's the same source-->
<!--Notice I even tried a dummy converter and doesnt reach there-->
<tk:DataGridComboBoxColumn
Header="Group"
DisplayMemberPath="Title"
SelectedValuePath="GroupId"
ItemsSource="{Binding Group.Category.Groups,
Converter={StaticResource DummyConverter}}"
SelectedValueBinding="{Binding Group.GroupId}"
/>
</tk:DataGrid.Columns>
</tk:DataGrid>
Aktualizacja
Czy powiedziałbyś, że problem polega na tym, że właściwość ItemsSource nie może być ustawiona na wiązanie nie statyczne? Podejrzewam to, ponieważ nawet ja ustawiłem ItemsSource na{Binding}
zDummyConverter
nie kończy się na konwerterze; aw kategorii ComboBox działa dobrze.