I'm building a project that loads data from a webservice into a TreeView Control. When the TreeView is contained on the LayoutRoot grid by itself and it's height is set to Auto, if the contents extend beyond the vertical or horizontal limits of the treeview scrollbars appear automatically, as expected.
If that same TreeView control is placed inside a StackPanel, it's behavior changes. When data extends past it's limits, no scrollbar appears and data simply clips off the edge with no access to it. If I manually set the height of the TreeView in this scenario, the scrollbars will appear again as expected.
Clearly there seems to be some interaction between the StackPanel and TreeView that I'm not seeing.
Can anyone explain this and suggest an appropriate way to handle the situation?
Per request in comments:
The following XAML works fine and renders scrollbars as expected (notice the Height on the TreeView is Specified):
<StackPanel >
<controls:TreeView ItemTemplate="{StaticResource MainEntryIndexTemplate}"
x:Name="CodeBookIndexTreeView" Height="500" />
</StackPanel>
The following also displays scrollbars as expected (notice no StackPanel, but the TreeView's Height is set to Auto):
<controls:TreeView ItemTemplate="{StaticResource MainEntryIndexTemplate}"
x:Name="CodeBookIndexTreeView" Height="Auto" />
Finally, this code fails in that the TreeView will not display scrollbars and data scrolls off the bottom and/or right hand side of the control (notice the TreeView is in a StackPanel and the TreeView's Height is set to Auto):
<StackPanel >
<controls:TreeView ItemTemplate="{StaticResource MainEntryIndexTemplate}"
x:Name="CodeBookIndexTreeView" Height="Auto" />
</StackPanel>
Cheers,
Steve