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

Opening RadWindow from User Control, RadWindow loses its properties

4 Answers 182 Views
Window
This is a migrated thread and some comments may be shown as answers.
Simone
Top achievements
Rank 1
Simone asked on 27 Jan 2012, 06:34 PM
Window is losing its Behaviors, and Width and Height properties
The window opens with a small size, and all extra buttons, maximize, minimize, etc, which I don't need. I only need the Close button.

Here's the ascx code:

<telerik:RadWindowManager ID="RadWindowManagerRepPayments" ShowContentDuringLoad="false" VisibleStatusbar="false"
    ReloadOnShow="true" runat="server" EnableShadow="true" Width="1500px" Height="500px">
    <Windows>
        <telerik:RadWindow ID="wndRepPaymentsEdit" runat="server" Behaviors="Close" OnClientClose="OnClientCloseRepPayments"
            Width="1500px" Height="500px" Title="Payment" NavigateUrl="RepPaymentsEdit.aspx">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

Here's the javascript for opening:

var oWnd = radopen("RepPaymentsEdit.aspx" + "?RepID=" + repID + "&RepPaymentsID=" + id, "wndRepPaymentsEdit");


Also, if I change the window size, and open it again, it resizes it. I don't want resizing. I just want to be able to open and close it with a specific size.

4 Answers, 1 is accepted

Sort by
0
Simone
Top achievements
Rank 1
answered on 27 Jan 2012, 08:33 PM
I was able to solve my problem by calling radwindow.show instead of radopen.

I also had to add a return false; after the call because it was creating the postback and the window was closing immediately. 

I don't understand why the behavior, it did not happen when I was using radopen  ??? 

Frustrating problem, and I still don't get it.

This is the code I ended up with..
var oWnd = $find("<%= wndRepPaymentsEdit.ClientID %>");
oWnd.setUrl("RepPaymentsEdit.aspx" + "?RepID=" + repID + "&RepPaymentsID=" + id);
oWnd.show();

OnClientClick="OpenWndRepPaymentsEdit();return false;"
0
Marin Bratanov
Telerik team
answered on 30 Jan 2012, 12:00 PM
Hello Simone,

The behavior from your first post is most likely related to the presence of more than one RadWindowManager on the rendered page. This scenario is discussed in the following help article: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-wrong-window-opened.html. Please examine it carefully, as it will shed some light on the behavior of radopen vs $find().show().

As for the postback - generally it should be avoided, just as you have noticed. Why it was working before I cannot be certain, but most likely it has been a partial postback (i.e. an AJAX request) that did not dispose the RadWindow you had opened, as it was created by a manager that was outside of the update panel that I assume resides in your UC.


Greetings,
Marin
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
Simone
Top achievements
Rank 1
answered on 31 Jan 2012, 03:59 PM
Thanks so much for your reply.
Very helpful.
Thanks,
Simone
0
Lena
Top achievements
Rank 1
answered on 23 May 2013, 06:39 PM
Simone,
Can you please verify what are your setURL and Show functions? I am havin the same issue, I have 2 radwindows in my page and the second one does not have any of the attributes I assign to it in the RadWindowManager

Thanks
Tags
Window
Asked by
Simone
Top achievements
Rank 1
Answers by
Simone
Top achievements
Rank 1
Marin Bratanov
Telerik team
Lena
Top achievements
Rank 1
Share this question
or