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

11 posts, 0 answers
  1. bo
    bo avatar
    26 posts
    Member since:
    Jan 2009

    Posted 23 Feb 2009 Link to this post

    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> 

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Feb 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. bo
    bo avatar
    26 posts
    Member since:
    Jan 2009

    Posted 04 Mar 2009 Link to this post

    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> 

  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 05 Mar 2009 Link to this post

    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.
  6. Marco
    Marco avatar
    20 posts
    Member since:
    Feb 2009

    Posted 11 Mar 2009 Link to this post

    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.





  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 13 Mar 2009 Link to this post

    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.
  8. ciwan savas
    ciwan savas avatar
    2 posts
    Member since:
    Aug 2009

    Posted 18 Aug 2009 Link to this post

    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
  9. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 19 Aug 2009 Link to this post

    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.
  10. ciwan savas
    ciwan savas avatar
    2 posts
    Member since:
    Aug 2009

    Posted 19 Aug 2009 Link to this post

    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
  11. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Aug 2009 Link to this post

    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.
  12. ridwaan
    ridwaan avatar
    1 posts
    Member since:
    Jul 2012

    Posted 14 Jul 2013 Link to this post

    Thanks this method works great everytime! Had the same problem, but working now using the OnClientShow and sender.maximize();
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017