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

Radwindow AutoSize fluctuates

4 Answers 178 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 06 Mar 2013, 07:25 PM
Ok, i know there is a big problem with the auto resize of radwindows but i think i'm very close to getting my version working. 

I've followed the guides here from these threads:

http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx
http://www.telerik.com/community/forums/aspnet-ajax/window/resize-radwindow-based-on-content-not-onload.aspx
http://www.telerik.com/community/forums/aspnet-ajax/window/resizing-problem-and-autoresize-option.aspx
http://www.telerik.com/community/forums/orm/general-discussions/to-resize-rad-window-on-the-change-of-the-size-of-control-on-it.aspx
http://www.telerik.com/community/forums/aspnet-ajax/window/best-way-to-resize-window-when-content-changes-via-javascript.aspx

But what is happening is that first my radwindow on chrome shows up very very small and then grows to the appropriate size. This kinda sucks but hey if it happens the first time i can deal with that. The problem is that every time i call "AdjustRadWidow" it does this behavior. This is unlike the demo's above.

Calling code block:
<telerik:RadWindowManager ID="RadWindowManager1" Overlay="true"  runat="server" Modal="true" EnableViewState="false"
    VisibleStatusbar="false" Behaviors="Close,Move,Resize" Skin="skr" EnableEmbeddedSkins="false" OnClientPageLoad="AdjustRadWidow" autoSize="true" >
</telerik:RadWindowManager>

My javascript block: this is functionaly equivalent to the code above but i made changes so it works with my custom skin. 

function AdjustRadWidow() {
    try {
        var manager = GetRadWindowManager();
        var oWindow = manager.GetActiveWindow();
    }
    catch (err) {
        var oWindow = GetRadWindow();
    }
    setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
}
//fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layout
function ChromeSafariFix(oWindow) {
    var iframe = oWindow.get_contentFrame();
    var body = jQuery('iframe[name=RadWindow1]').contents().find(".content");
    if (typeof jQuery(body).html() === 'undefined') {
        body = jQuery('.content');
    }
    setTimeout(function () {
        var height = jQuery(body)[0].scrollHeight + 275;
        var width = jQuery(body)[0].scrollWidth + 70;
        var iframeBounds = $telerik.getBounds(iframe);
        var heightDelta = height - iframeBounds.height;
        var widthDelta = width - iframeBounds.width;
        if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta);
        if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta);
        oWindow.center();
    }, 310);
}


How can i fix this.

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Mar 2013, 04:00 PM
Hi Chris,

I advise that you follow this help article on getting autosizing to work properly: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-autosize-not-correct.html.

On the resizing - if animations are enabled you will see the size change, so I advise that your remove them. Passing true as an argument to the autoSize() method causes it to animate, removing this argument should help.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Chris
Top achievements
Rank 1
answered on 07 Mar 2013, 04:41 PM
I followed the guide you supplied and still no good. When i set "autosize = false" i no longer get the animation but the window still resizes to a very small size and then jumps to the appropriate size. This only happens on chrome/safari and it doesn't matter if i use the stocks window style.

0
Marin Bratanov
Telerik team
answered on 11 Mar 2013, 11:16 AM
Hi Chris,

I am not aware of such browser-specific behaviour and I advise that you post the markup that is causing this issue so I can reproduce and investigate it. This includes the full RadWindow declaration, the way it is opened and the content page. Usually autosizing issues stem from the content that is supplied. You can follow the guidelines from this blog post to strip down as much irrelevant markup as possible.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Qurat
Top achievements
Rank 1
answered on 12 Mar 2013, 07:57 AM
hi Marin,

i am trying to use client template for my radhtmlchart but i am unable to do it because i am using a dataset from the DB.
i tried using this 
  //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = ds.Tables[0].ToString();
it is also not working.
please help me i have to submit the project and i have very less time

here is a piece of code :
 DataSet ds = DbHelper.ReadTable(sql1);
    
        if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
        {
            //string[] arr = new string[15];
           
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                SeriesItem si = new SeriesItem();
                si.YValue = (decimal)ds.Tables[0].Rows[i]["VoteShare"];
                si.Name = (string)ds.Tables[0].Rows[i]["PartyName"];
                 
                si.BackgroundColor = System.Drawing.ColorTranslator.FromHtml((string)ds.Tables[0].Rows[i]["PartyColor"]);
                PieChart1.PlotArea.Series[0].Items.Add(si);
                //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = (string)ds.Tables[0].Rows[i]["PartyName"];
                //arr[i]=si.Name.ToString();
                
            }

            //PieChart1.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = ds.Tables[0].ToString();
            
        



regards
@nnu shah
punjab lok sujag

Tags
Window
Asked by
Chris
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Chris
Top achievements
Rank 1
Qurat
Top achievements
Rank 1
Share this question
or