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
315
Need to properly automatically resize the XamGrid in a UserControl
posted

Hello Infragistics-Support!

I'm having small problems correctly resizing a XamGrid that sits inside a Grid (no columns set) that sits inside a UserControl.
This UserControl is then used in a Window that resizes itself to content.
If possible, the user shall not need to care about the window size.

Without setting anything, the XamGrid, although completely empty sizes up to screen width!!! --> Why?

If I define a column, the XamGrid always sizes up to the content, even if it get's bigger than the UserControl allows.

As soon as I set MaxHeight and MaxWidth properties of the XamGrid, it sizes driectly up to these values, although it's still empty!!!

Can you give me some hints/help about, how to let this XamGrid automatically resize itself properly, or do I need to program something in the code behind to do this?

Best regards

Stefan Schmitt

Parents
  • 35319
    Verified Answer
    posted

    Hi Stefan,

     

    Thank you for your post. I have been looking into your question and the XamGrid is designed to be stretched to fill the available space of its parent.

     

    In order to resize itself to the necessary size for the available columns and rows you could position the XamGrid in two StackPanels like e.g.:

     

            <StackPanel>

                <StackPanel Orientation="Horizontal">

                    <ig:XamGrid Name="xamGrid1" >

                    </ig:XamGrid>

                </StackPanel>

            </StackPanel>

     

    Let me know, if you need any further assistance on this matter.

Reply Children
No Data