Closing RadGrid Edit Form Modal Window

3 posts, 0 answers
  1. Liam
    Liam avatar
    13 posts
    Member since:
    Sep 2008

    Posted 23 Jul 2009 Link to this post

    I'm using a custom user control in my RadGrid to add new customer using the below markup.

    <EditFormSettings EditFormType="WebUserControl" UserControlName="~/controls/customer/Details.ascx">  
    <PopUpSettings Width="600px" Height="400px" Modal="true" /> 
    </EditFormSettings> 

    In the user control I have a save button which saves the data to the database and once this is done I want it to close the (modal edit) window and navigate the browser (parent) window to the customer preview screen.

    So in my code behind I've placed the following (I've used this code for RadWindows before and it works fine).

    string script = "<script language='javascript' type='text/javascript'>CloseAndRedirect('" + VOPCustomerID.ToString() + "');</script>";  
    Page.ClientScript.RegisterStartupScript(this.GetType(), "Close", script); 

    I have the below in the page (again, used this before with RadWindows and all is fine).

    <script type="text/javascript">  
        function CloseAndRedirect(ss)  
        {  
            //Redirect to new url  
            GetRadWindow().BrowserWindow.location.href = '../Customer/Default.aspx?CustID=' + ss;  
            //closes the window  
            GetRadWindow().close();  
        }  
          
        //Get reference to window  
        function GetRadWindow()  
        {  
            var oWindow = null;  
            if (window.radWindow)  
                oWindow = window.radWindow;  
            else if (window.frameElement.radWindow)  
                oWindow = window.frameElement.radWindow;  
            return oWindow;  
        }          
    </script> 

    As I've said, I've used the above two pieces of code before with RadWindows and all is fine, they close and the browser window navigates to the new screen.

    However with the Edit Form, the modal popup does close and then reopens and the browser does not navigate to the preview screen. When I tried removing the redirection in the JavaScript and only close the popup window the same happens, the window closes and then opens again.

    Is there some other setting I need to set here?

    Thanks.


    Liam
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 28 Jul 2009 Link to this post

    Hi Liam,

    I went through your code and it looks fine to me. Therefore I suggest that you check out this online demo on window editing for RadGrid and see if you missed something out.

    Kind regards,
    Iana
    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. Dustin Blair
    Dustin Blair avatar
    1 posts
    Member since:
    Feb 2010

    Posted 24 Feb 2010 Link to this post

    What a cop out!
Back to Top