This is a migrated thread and some comments may be shown as answers.

RadWindowManager autosize not working

1 Answer 281 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 20 Dec 2016, 11:18 PM

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.

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 23 Dec 2016, 11:32 AM

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.
Tags
Window
Asked by
Andrey
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or