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
1065
How to turn on scrollbar
posted

Hello,

I put a datagrid in a window. The size of the window is smaller than the size of the datagrid, but there is no scrollbar turned on automatically.

How could I turn on the scrollbar?

Thanks.

Parents
  • 9694
    posted

    Hello,

    Check the layout properties for the XamDataGrid in your layout. Is it in a Grid? Is the Grid set to Auto Size Width and Height and Vertical and Horizontal Alignment set to Stretch? Are those same properties for the XamDataGrid also set to Width=Auto and Height=Auto and VerticalAlignment=Stretch and HorizontalAlignment=Stretch. These are the default settings. So if your XAML does not have any of these properties set, then you should be OK.

    If the element is set to be positioned VerticalAlignment to Top and HorizontalAlignment to Left, then the element (such as the XamDataGrid) will span to the right and to the bottom. However, if they are set to Stretch with Auto Width and Height, the grid will span to fit its container. And the scrollbars will automatically appear.

    Additionally, make sure that VerticalScrollbarVisibility and HorizontalScrollbarVisibility are set to Auto or Visible (or not set at all in your XAML).

    If this does not solve your issue, paste the XAML here that we might see what is going on.

    Thanks!

Reply Children