Questions using RadWindowManager and Ajax

3 posts, 1 answers
  1. Reid
    Reid avatar
    448 posts
    Member since:
    Oct 2008

    Posted 12 Apr 2009 Link to this post

    I have a "links" section on the site that displays links as descriptions in a column in a RadGrid.  Using the ItemCommand event I get the dataitem and establish the hyperlink or location the user can visit.  Using RegisterStartupScript and the RadWindowManager I can bring up a modal style window for the user that works great for presentation.  

    protected void grdSponsoredLinks_ItemCommand(object source, GridCommandEventArgs e) 
            SponsoredLink sponsoredLink = GlobalMethods.GetController().DataCache.SponsoredLinks[e.Item.ItemIndex]; 
            switch ( e.CommandName ) 
                case "RowClick"
                        string normalizedURL = sponsoredLink.LinkNavigationURL; 
                        if ( !normalizedURL.Contains("http") ) 
                            normalizedURL = "http://" + normalizedURL; 
                        RadAjaxPanel ajaxPanel = (RadAjaxPanel) HTMLUtility.FindControlRecursive(this.Master, "ajaxPanelLinks");                 
                        RadWindowManager windowManager = (RadWindowManager) HTMLUtility.FindControlRecursive(this.Master, "RadWindowManagerLinks"); 
                        string myScript = String.Format("$find('{0}').open('" + normalizedURL + "');", windowManager.ClientID); 
                        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "OpenWindowKey", myScript, true); 

    The questions I have are:
    1. The MainMenu (RadMenu) component on the MasterPage does not remain behind the modal window when the window is moved around on the screen (using IE 7).  I tried setting the z-index using another thread in these forums (z-index) and it has no effect.  Actually the hyperlink manager dialog we use in these forums to insert hyperlinks displays the window in a modal mode and has the effect I desire.
    2. Is there a way to create a master page for the window that opens that could contain a large close or bookmark button?
    3. Setting the RadWindowManager width and height seems to correlate to the window sizes.  Is this better controlled otherwise?
    4. Once Maximized when the user browses back on the IE navigation it leaves the host page and returns to the previous page, in this case the main or default page.  Is there a way to stop that behaviour so that as the popup modal window browses back (unless they have clicked links on the "links" page they were directed to) it closes instead of navigating off the :links" page?


  2. Answer
    Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 13 Apr 2009 Link to this post

    Hi Reid,

    Straight to your questions:
    1. Indeed, setting the z-index for the corresponding control is the correct way. Could you please tell me how exactly do you set it? Try setting style="z-index: 2900" for the RadMenu control or
      style="z-index: 8000" for the RadWindowManager.
    2. As I understand your question, you want to do that in the content page - the one displayed inside the RadWIndow. If this is so - yes, this is perfectly possible. You could create custom buttons and use the client-side API to control the RadWindow from it. More information on RadWindow's API and its usage is available in the documentation, section Controls / RadWindow / Programming.
    3. There is a setSize() client-side method that you could use - all RadWindows could have different size, pre-set with the Width and Height properties, or changed dynamically with the client-side API.
    4. I am afraid this is not possible - the "back" button's behavior is controlled by the browser only and we cannot affect it. If you could implement a custom solution that would work with a standard IFRAME and behaves according to your requirements, the same approach would work with RadWindow as well - the RadWindow is basically an IFRAME and it behaves just like one.

    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. Reid
    Reid avatar
    448 posts
    Member since:
    Oct 2008

    Posted 14 Apr 2009 Link to this post

    Thanks for the reply.

    1) I was not using the correct value in the zOrder it is working fine now.

    In the MasterPage.cs PageLoad()

    2) The urls of the pages the RadWindowManager sponsors are external sites so I would have no control on the pages.  I guess I was looking for any examples that create a page using the RadWindowManager that has buttons and a URL (or the sorts) property that loaded the document into a div or other strategy.

    Other points taken, thanks
Back to Top