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
1410
XamGrid - VerticalAlignment Top does not work - its always stretched
posted

Hello

Im using Infragistics for WPF 12.2.20122.2202

Very simple scenario: I have a view and want to have XamGrid that is not stretched to the parent container - instead - it should be vertically alignment to the top.

The problem is that, whatever I set for the VerticalAlignment, the content seems to be always stretched

(how I know this, well - if there are many columns, the HorizontalScrollBar appears on the very bottom. Instead - it should appear just under the last row within a grid).

Is there any way to achieve this?

Parents
  • 12875
    posted

    Hi,

    The most straight-forward approach is to give the grid a specific height.

    There isn't any specific property but if you put the xamGrid in a stackpanel you can use the VerticalAlignment of Top and the grid will only use the vertical space it needs and the horizontal scrollbar will follow immediately at the bottom of the last row.  The drawback is that the vertical scrolling is lost because the grid has no idea how much vertical space is required.  And if you have a lot of rows they may be clipped off.  That's caused by putting the control in a stackpanel.  So you may still need to give the grid a specific height.

    Let me know if either of these options helps you.

     

Reply Children