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
470
Resize Panel based on contents
posted

Is there a property of the webpanel to have it resize to display the contents in it? I dynamically build a table in a webpanel. The table could have 4 rows or it can grow to 30 rows, it depends on the data. I would like to webpanel to grow to display the whole table. Other then incrementing a variable based on the number of rows and then setting the height property, I was wondering if there was a property of the webpanel that would automatically handle it.

Thanks,
Steve

  • 7694
    posted

     You can wrap your content in a div without setting width / height explicitly and then WebPanel will automatically assume width / height of the child content, e.g.
    Please take a look code below:

    <igmisc:WebPanel ID="WebPanel1" runat="server">
            <Template>
                <div style="width: 10px; height: 10px; overflow: scroll;">
                    <img alt="" src="" />
                </div>
            </Template>
        </igmisc:WebPanel>
    Hope this helps.