I have a main datagrid, then an accordion control below it. In one of the accordion items I have another datagrid that binds to the selected item of the first datagrid. Simple xaml is:
<sdk:DataGrid Name="dgMain" ItemsSource="{Binding SomeSource}" />
<toolkit:Accordion>
<toolkit:AccordionItem Header="Details">
<sdk:DataGrid ItemsSource="{Binding ElementName=dgMain, Path=SelectedItem.Children}"/>
</toolkit:AccordionItem>
</toolkit:Accordion>
I have VerticalAlignment property of the second grid set to "Stretch" so it stretches as different collection sizes are bound to it, but the problem is it only stretches within the AccordionItem size so if I select a new item in the first grid that has more "Children" then I have to scroll the second grid because the AccordionItem didn't change.
AccordionItem region will only change when i condense and expand it again. Setting VerticalContentAlignment to "Stretch" for the accordion item does not work. I guess because it only triggers this when first expanded.
Does anyone know what else I could try or if I'm missing something. I'd prefer to stick with xaml solution so I can stay MVVM-friendly, but glad to hear everything.