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

radwindow opens fine the first time, 2nd time the size is hosed up

10 Answers 470 Views
Window
This is a migrated thread and some comments may be shown as answers.
bo
Top achievements
Rank 1
bo asked on 23 Feb 2009, 05:17 PM
The first time the radwindow opens, all is well...The 2nd time the sizing is all hosed up (looks like a default size ~150x150).

Any ideas?
<telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" runat="server" 
        Skin="Web20" Modal="true" DestroyOnClose="true" > 
        <Windows> 
            <telerik:RadWindow runat="server" ID="CoreCodeDialog" Width="600" Height="400" Behaviors="Close" 
                NavigateUrl="CoreProcedure.aspx" ShowContentDuringLoad="false" Title="Select Core Code"
            </telerik:RadWindow> 
            <telerik:RadWindow runat="server" ID="BundleDialog" Width="800" Height="450" Behavior="None"  
                NavigateUrl="ProcedureBundle.aspx" ShowContentDuringLoad="false" Title="Bundle Procedures"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

10 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 24 Feb 2009, 08:22 AM
Hi Bo,
You have set the DestroyOnClose property to true. When this property is enabled, RadWindow's object is destroyed once the window is closed and you cannot open that same RadWindow again until the page is reloaded. In scenarios like this (DestroyOnClose=true), you need to set the needed properties (width, height, etc.) when opening the RadWindow by using its client-side API.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
bo
Top achievements
Rank 1
answered on 04 Mar 2009, 06:34 PM
you were right...that took care of it...now i have another page that is doing it..
cept this time the code seems to be right..any other ideas?
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Web20" VisibleStatusbar="false" 
        ReloadOnShow="true" Modal="true" > 
        <Windows> 
            <telerik:RadWindow Skin="Web20" ID="RefMDDialog" runat="server" Title="Ref MD Dialog" 
             Height="400px" Width="600px" ShowContentDuringLoad="false" 
             DestroyOnClose="false"  /> 
        </Windows> 
    </telerik:RadWindowManager> 

0
Georgi Tunev
Telerik team
answered on 05 Mar 2009, 10:50 AM
Hi bo,

To be able to help in this case, I need to have a better view over your exact setup and project's logic. Please isolate the problem in a small sample project and send it to me in a support ticket. I will check it right away.


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Marco
Top achievements
Rank 1
answered on 11 Mar 2009, 10:14 AM
Hello,

I am also experiencing bo's problem. I launch the windows from image buttons in a template column in a radgrid (located in a content page that inherits from a masterpage). When I click the cancel buttons on the window and simply close the window, the original settings i specify are maintained. However, when I click a button that does something then executes an ajax request to refresh the underlying grid, every window I open loses the settings I previously defined.

My RadWindowManager/Window setup:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="None"  
                InitialBehaviors="Pin" KeepInScreenBounds="True" Modal="True"  
                PreserveClientState="True" ReloadOnShow="True" ShowContentDuringLoad="False"  
                VisibleStatusbar="False"
                <Windows> 
                    <telerik:RadWindow Skin="Vista"  ID="InsertTaskWindow" runat="server"  
                        Title="Criar Tarefa" Height="620px" 
                        Width="750px" Left="" Modal="true" Overlay="True"  
                        ShowContentDuringLoad="False" Behavior="None" Behaviors="None"  
                        InitialBehavior="Pin" InitialBehaviors="Pin" ReloadOnShow="True"  
                        VisibleStatusbar="False" KeepInScreenBounds="True"  /> 
                    <telerik:RadWindow Skin="Vista"  ID="EditTaskDialog" runat="server"  
                        Title="Editar Tarefa" Height="620px" 
                        Width="750px" Left="" Modal="true" Overlay="True"  
                        ShowContentDuringLoad="False" Behavior="None" Behaviors="None"  
                        InitialBehavior="Pin" InitialBehaviors="Pin" ReloadOnShow="True"  
                        VisibleStatusbar="False" KeepInScreenBounds="True"  /> 
                    <telerik:RadWindow ID="ConfimTaskDialog" runat="server" Behavior="None"  
                        Title="Concluír Tarefa" 
                        Behaviors="None" InitialBehavior="Pin" InitialBehaviors="Pin"  
                        Height="150px" 
                        Width="300px" VisibleStatusbar="False" 
                        KeepInScreenBounds="True" Left="" Modal="True" NavigateUrl=""  
                        ReloadOnShow="True" ShowContentDuringLoad="False" Top="" Skin="Vista"
                    </telerik:RadWindow> 
                    <telerik:RadWindow ID="ValidateTaskDialog" runat="server" Behavior="None"  
                        Behaviors="None" Height="150px" 
                        Width="300px" InitialBehavior="Pin" InitialBehaviors="Pin"  
                        KeepInScreenBounds="True" Left="" Modal="True" NavigateUrl=""  
                        ReloadOnShow="True" style="display:none;" Title="Validar Tarefa" Top=""  
                        VisibleStatusbar="False" ShowContentDuringLoad="False" Skin="Vista"
                    </telerik:RadWindow> 
                    <telerik:RadWindow ID="ViewTaskNotesDialog" runat="server" Behavior="None"  
                        Height="400px" 
                        Width="400px" 
                        Behaviors="None" InitialBehavior="Pin" InitialBehaviors="Pin"  
                        KeepInScreenBounds="False" Left="" Modal="True" NavigateUrl=""  
                        ReloadOnShow="True" ShowContentDuringLoad="False" VisibleStatusbar="False"  
                        Skin="Vista"  
                        style="display:none;" Title="Notas sobre Tarefa" Top=""
                    </telerik:RadWindow> 
                    <telerik:RadWindow ID="DeleteTaskDialog" runat="server" Behavior="None"  
                        Title="Apagar Tarefa" 
                        Behaviors="None" InitialBehavior="Pin" InitialBehaviors="Pin"  
                        Height="150px" Width="300px" 
                        KeepInScreenBounds="True" Left="" Modal="True" NavigateUrl=""  
                        ReloadOnShow="True" VisibleStatusbar="False"  
                        ShowContentDuringLoad="False" Top="" Skin="Vista"
                    </telerik:RadWindow> 
                    <telerik:RadWindow ID="ViewTaskHistoryWindow" runat="server" Behavior="None"  
                        Height="550px" 
                        Width="1150px" 
                        Behaviors="None" InitialBehavior="Pin" InitialBehaviors="Pin"  
                        KeepInScreenBounds="True" Left="" Modal="True" NavigateUrl=""  
                        ReloadOnShow="True" ShowContentDuringLoad="False" style="display:none;"  
                        Title="Histórico de Tarefas" Top="" VisibleStatusbar="False"
                    </telerik:RadWindow> 
                </Windows> 
            </telerik:RadWindowManager> 

Example Window JavaScript:
<script type="text/javascript">  
            function CloseAndRebind(args) {  
                GetRadWindow().Close();  
                GetRadWindow().BrowserWindow.refreshGrid(args);  
            }  
  
            function GetRadWindow() {  
                var oWindow = null;  
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog  
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)  
  
                return oWindow;  
            }  
  
            function CancelEdit() {  
                GetRadWindow().Close();  
            }  
             
             
        </script> 

Code executed on clicking a cancel button:
protected void LnkCancelChanges_Click(object sender, EventArgs e) 
    { 
        ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CancelEdit();"true); 
    } 

Code executed on clicking "accept" button:
protected void LnkAcceptChanges_Click(object sender, EventArgs e) 
    { 
        int result = SqlDataSourceEdit.Update(); 
 
        ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true); 
    } 

JavaScript refresh grid function on content page:
function refreshGrid(arg) {  
                        $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>").ajaxRequest("Rebind");  
                    }  

Ajax request code on content page:
protected void RadAjaxManagerProxy1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        RadGrid grid = (RadGrid)LoginView1.FindControl("RadMultiPageMain").FindControl("PageViewTarefas").FindControl("RadGridTarefas"); 
        if (e.Argument == "Rebind"
        { 
            grid.MasterTableView.SortExpressions.Clear(); 
            grid.MasterTableView.GroupByExpressions.Clear(); 
            grid.Rebind(); 
        } 
        else if (e.Argument == "RebindAndNavigate"
        { 
            grid.MasterTableView.SortExpressions.Clear(); 
            grid.MasterTableView.GroupByExpressions.Clear(); 
            grid.MasterTableView.CurrentPageIndex = grid.MasterTableView.PageCount - 1; 
            grid.Rebind(); 
        } 
    } 

Any Ideias?

Thanks in advance.





0
Fiko
Telerik team
answered on 13 Mar 2009, 04:09 PM
Hello Marco,

In your case we need to examine your exact setup, including your Master page, the RadGrid, RadAjaxManagerProxy, RadWindowManager declarations. Could you please open a new support ticket and send us a simple demo project that reproduce the problem? Once we have a better view over your exact configuration we will do our best to help.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ciwan savas
Top achievements
Rank 1
answered on 18 Aug 2009, 03:53 PM
hi there,

I have an application and I'm using RadWindowManager. I want RadWindowManager to maximize all the page once i click them.
It doesn't to it first time but when i clic, X and re-click it again it maximize it. Does anyone know the reason? as i have initialbehavior and initialbehaviors=Maximise. Am i doing something wrong?

Can anyone help please

Thanks
ciwan
0
Georgi Tunev
Telerik team
answered on 19 Aug 2009, 07:31 AM
Hi ciwan,

The easiest way to ensure that a RadWindow will be maximized every time it is opened is to explicitly call its maximize() method every time you show it.
e.g.
var oWnd = radopen('MyPage.aspx', "MyRadWindow");
oWnd.maximize();


I hope this helps.

Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ciwan savas
Top achievements
Rank 1
answered on 19 Aug 2009, 08:43 AM
thanks Georgi for your reply.
But where will i put this code in the page_load? and im using VB.net.
I have loads of pages so will i have to put this code to on each page?

Thanks
ciwan
0
Shinu
Top achievements
Rank 2
answered on 19 Aug 2009, 09:47 AM
Hi Ciwan,

You can also try attaching the OnClientLoad event to RadWindowManager and explicitly maximize the window in the event handler using maximize() method which will maximize the window every time you show it..

ASPX:
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"  OnClientShow="OnClientShow"
    <Windows> 
      . . . 
    </Windows> 
</telerik:RadWindowManager> 

JavaScript:
 
<script type="text/javascript"
function OnClientShow(sender, args) 
    sender.maximize(); 
</script> 

Feel free to share the comments.
-Shinu.
0
ridwaan
Top achievements
Rank 1
answered on 14 Jul 2013, 11:26 AM
Thanks this method works great everytime! Had the same problem, but working now using the OnClientShow and sender.maximize();
Tags
Window
Asked by
bo
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
bo
Top achievements
Rank 1
Marco
Top achievements
Rank 1
Fiko
Telerik team
ciwan savas
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
ridwaan
Top achievements
Rank 1
Share this question
or