Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Scrollviewer inside OutlookBarGroup?
posted

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!

Parents
No Data
Reply
  • 54937
    Verified Answer
    Offline posted

    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.

Children