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
405
Can I make stackpanel with XamTrees in it scrollable?
posted

I have 2 trees in a stackpanel in a grid column, I want that stackpanel to show a vertical scroll bar so as the 2 trees are expanded I can scoll down. Currently it cuts off at the bottom.  I have tried using the Scrollviewer attribute on the grid, stackpanel to no avail.  Is there a way to do this easily?

Here is the pseudo code...

 <Grid x:Name="LayoutRoot" Background="#19246286">

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="300"/>

            <ColumnDefinition Width="300" />

            <ColumnDefinition />

        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>

            <RowDefinition Height="25" />

            <RowDefinition Height="580" />

            <RowDefinition Height="25" />

        </Grid.RowDefinitions>

        <StackPanel Orientation="Vertical" Grid.Row="1" Height="Auto" VerticalAlignment="Top" >

            <ig:XamTree x:Name="xamTree1" x:FieldModifier="public" Background="#FFAED0E6">

                <ig:XamTreeItem....

            </ig:XamTree>

            <ig:XamTree x:Name="xamTree2" x:FieldModifier="public" Background="#FFAED0E6">

                <ig:XamTreeItem .......

            </ig:XamTree>

        </StackPanel>

Parents
  • 8421
    posted

    Hello,

    This should be possible by setting an explicit Height for your StackPanel (though I think this might be taken care of by setting the height on the Grid row). Also, set the StackPanel's ScrollViewer.VerticalScrollBarVisibility property to "Auto".

Reply Children