RadWindow override maximize

5 posts, 0 answers
  1. paulo.galão
    paulo.galão avatar
    11 posts
    Member since:
    Aug 2007

    Posted 25 Jan 2008 Link to this post


    Hi there,

    In order to define the window size when it is maximized I'm setting its style as follows:

    div.radwindow_ModalWin.maximizedwindow

    {
       height:80% !important;
       left:0pt !important;
       top:0pt !important;
       width:80% !important;
    }

    The problem is that the actual radwindow implementation overrides it with:

    div.radwindow.maximizedwindow
    {
       height:100% !important;
       width:100% !important;
    }

    The question is: is there any way to define window size when it is maximized?

    Thanks,
    Paulo
  2. paulo.galão
    paulo.galão avatar
    11 posts
    Member since:
    Aug 2007

    Posted 28 Jan 2008 Link to this post

    Just a little update. At the moment I am doing it as follows:

    function show(url)
        {
            var w = window.radopen(url, 'commonPopup');

            w.isInMaxMode = false;
            w.onCommand = function(which)
            {
                if (which = "Maximize" )
                {
                    this.isInMaxMode = !this.isInMaxMode;

                    if ( !this.isInMaxMode )
                    {
                        //'normalize'
                        Telerik.Web.CommonScripts.removeCssClasses(this._popupElement,["almostmaximizedwindow"]);
                        return(false);
                    }
                    else
                    {
                        //'maximize'
                        Telerik.Web.DomElement.addCssClass(this._popupElement,"almostmaximizedwindow");
                        return(false);
                    }
                }
                else
                {
                    return(true);
                }             
            }
        }

    It works but I think it is a bit clumsy. So... my question remains: is there a more elegant way to achieve this?

    Thanks,
    Paulo

  3. George
    Admin
    George avatar
    298 posts

    Posted 30 Jan 2008 Link to this post

    Hello paulo.galão,

    You can define custom maximize size using JavaScript but not when its state is "maximized", because the custom width will not be considered. I have prepared and attached one sample project regarding the issue. Please give it a try and in case of more questions do not hesitate to ask.

    Best wishes,
    George
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Bryan Tan
    Bryan  Tan avatar
    3 posts
    Member since:
    Apr 2010

    Posted 07 Apr 2010 Link to this post

    Hi,

    I tried the code from attachment above. I manage to set the custome size. But i got one problem which is when i wish to restore back the previous size, i unable to do it. Bcos the resize screen only have miximize button and minimize button.

    Can anyone help?

    Regards,
    Bryan Tan
  5. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 09 Apr 2010 Link to this post

    Hello Bryan Tan,

    The easiest way to set a custom size to a RadWindow when it is maximized, is to change the  rwMaximizedWindow css class as it shown in the following code.
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
        <style type="text/css">
           .rwMaximizedWindow
           {
               width: 600px !important;
               height: 600px !important;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
          <Windows>
             <telerik:RadWindow ID="RadWindow1" Height="370px" width="395px" runat="server" VisibleOnPageLoad="true">
             </telerik:RadWindow>
          </Windows>
          </telerik:RadWindowManager>
         </div>
        </form>
    </body>
    </html>
    Hope this helps.

    Sincerely yours,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top