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

RadWindow override maximize

4 Answers 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
paulo.galão
Top achievements
Rank 1
paulo.galão asked on 25 Jan 2008, 03:43 PM

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

4 Answers, 1 is accepted

Sort by
0
paulo.galão
Top achievements
Rank 1
answered on 28 Jan 2008, 02:31 PM

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

0
George
Telerik team
answered on 30 Jan 2008, 10:46 AM
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
0
Bryan Tan
Top achievements
Rank 1
answered on 07 Apr 2010, 08:30 AM
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
0
Petio Petkov
Telerik team
answered on 09 Apr 2010, 04:19 PM
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.
Tags
Window
Asked by
paulo.galão
Top achievements
Rank 1
Answers by
paulo.galão
Top achievements
Rank 1
George
Telerik team
Bryan Tan
Top achievements
Rank 1
Petio Petkov
Telerik team
Share this question
or