Hi, I'm trying to add scrollviewer inside the OutlookBarGroup. Here is my code:
#######################################################################
<igOB:OutlookBarGroup Header="test" IsSelected="True">
<StackPanel>
<Expander Name="testExpander" IsExpanded="True" HorizontalAlignment="Stretch" VerticalAlignment="Top" Background="#FFCEE3FF">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<TreeView Name="testTree">
<....many treeviewitem...>
</TreeView>
</ScrollViewer>
</Expander>
</StackPanel>
</igOB:OutlookBarGroup>
The scrollviewer doesn't show unless assigned height because the height of Expander is infinite. Then I tried binding scrollview's height to Expander's actualheight, but that won't work.
So I'm wondering how can I set the scrollviewer's height? Any suggestion will be appreciate!
Remove the StackPanel. It is not the Expander that is making the height infinite, it is the stackpanel. In this case you have a vertically arranged stackpanel and so the height of the elements in the stackpanel will be based on their desired height. BTW, the TreeView contains a ScrollViewer so I doubt you need a scrollviewer around it - actually it would mean you would be able to use virtualization in the treeview.
But there are more than one Expander inside the OutLookBarGroup. I have to put all expanders inside a StackPanel.