RadWindowManager autosize not working

2 posts, 0 answers
  1. Andrey
    Andrey avatar
    1 posts
    Member since:
    Oct 2016

    Posted 20 Dec 2016 Link to this post

    Hello, I am looking for support with the radwindowmanager and the autosize and autosize behavior properties...I've been trying to implement the same scenario as these two links:
    - http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/autosizing-issues

    -http://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx

    no luck... I always need to have a width and a height coming from the codebehind, else it only displays a small square. I am not sure if this is cause by the way the app is programmed...anyway hope somebody can jump in and help out. Thanks...here is the code driving the window: 

    starts here:
    gui.OpenRadWindow(
                                url: "/Pages/Inventory/Add_Product.aspx", 
                                width: 800, 
                                height: 550, 
                                title: "Add Product", 
                                modal: true, 
                                javascriptOnClientClose: "OnClientClose", 
                                page: Page
                            );

    goes to here:

     

    public void OpenRadWindow(string url, int width, int height, string title, bool modal, WindowBehaviors behaviors, bool showDuringLoad, string javascriptOnClientClose, Page page)
            {
                RadWindowManager winMgr = null;

                winMgr = (RadWindowManager)page.Master.FindControl("RadWindowManager_Global");

                if (winMgr != null)
                {
                    RadWindow radWindowForm = new RadWindow();
                    radWindowForm.ID = "radWindowForm_" + Guid.NewGuid().ToString();
                    radWindowForm.MinWidth = new System.Web.UI.WebControls.Unit(width,System.Web.UI.WebControls.UnitType.Pixel);
                    radWindowForm.MinHeight = new System.Web.UI.WebControls.Unit(height, System.Web.UI.WebControls.UnitType.Pixel);
                    radWindowForm.AutoSize = true;
                    radWindowForm.AutoSizeBehaviors = WindowAutoSizeBehaviors.Default;
                    radWindowForm.Title = title;
                    radWindowForm.Modal = modal;
                    radWindowForm.NavigateUrl = url;
                    radWindowForm.Behaviors = behaviors; 
                    radWindowForm.EnableShadow = true;
                    radWindowForm.EnableTheming = true;
                    radWindowForm.KeepInScreenBounds = true;
                    radWindowForm.ShowContentDuringLoad = showDuringLoad;
                    radWindowForm.VisibleStatusbar = false;
                    radWindowForm.VisibleOnPageLoad = true;
                    radWindowForm.OnClientClose = javascriptOnClientClose;
                    winMgr.EnableViewState = false;
                    winMgr.Windows.Add(radWindowForm);                
                }
            }

    this is the control in master page:

     

    <telerik:RadWindowManager ID="RadWindowManager_Global" runat="server" AutoSize="true" AutoSizeBehaviors="Default" Style="z-index: 7001" />

    thanks for the support. I will add additional info if needed.

  2. Ianko
    Admin
    Ianko avatar
    1568 posts

    Posted 23 Dec 2016 Link to this post

    Hello Andrey,

    The AutoSize behavior of RadWindow greatly depends on the HTML content that is rendered. The configuration seems accurate to me, but with some markup example of the content you want to load I can only assume why the AutoSize does not work as expected.

    Generally, you should make sure that the content rendered has fixed width and/or height, which will expand the size of the RadWindow.

    Regards,
    Ianko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top