KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have 3 tables: Item - which is the DataContext - it has a navigation column Group Group - has a navigation column Category. I want to have in the DataGrid both (Category & Group) columns and when I choose a category it should display in the group col only the Category.Groups. Here is the code I am working on: <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"
Tags (comma-separated)
Save Edits
Cancel