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
1540
No scrollbar appears on ContentPane
posted

I have a ContentPane containing a simple Grid which I add rows to programmatically at run-time.

When I reduce the size of the ContentPane so that not all the rows are visible, no vertical scrollbar appears.  How do I cause it so that a scrollbar does appear?

I have a attached a simple example of the problem I am having.

Many thanks,

Jason

ContentPane No Scrollbar Example.zip
Parents
  • 69686
    Verified Answer
    posted

    Hello Jason,

    I believe the Grid will measure its children elements infinite height if you do not set their height property explicitly and this is why it is happening. One thing that you can do is create a scrollviewer around the grid which will give you the Scrollbars.

    <ScrollViewer>

                            <Grid Name="grid">

                                <Grid.ColumnDefinitions>

                                    <ColumnDefinition />

                                </Grid.ColumnDefinitions>

                            </Grid>

                        </ScrollViewer>

                    </igDock:ContentPane>

Reply Children