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

[Solved] Windows Activate TopMost

5 Answers 158 Views
Window
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 29 Jul 2009, 05:55 AM
Hi:

If a have 2 windows, not maximized, I can switch between each other without any problem. I can convert each one in the topmost window.

But if I maximize one of them, after switch one time between the one maximized and the normal size window, the maximized remains as the topmost, even if I activate the normal size window. When I activate the normal size window, the titlebar of the one maximized becomes transparent, but the normal size window never converts into the topmost, I cannot see it on the fron.

Can you share a sample on how I can switch and activate between 2 windows: one maximized and one not-maximized?

Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Jul 2009, 06:49 AM
Hello iomega 55,

This behavior is by design - the maximized RadWindow will always receive the highest z-index. We do not recommend to override this behavior, but if you insist, I suggest to check this sample that shows how to achieve MDI with RadWindow and RadTabStrip. If you examine the OnClientShow and OnClientActivate functions, you will see how you can dynamically change the z-index for the currently active RadWindow.


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.
0
iomega 55
Top achievements
Rank 1
answered on 30 Jul 2009, 04:46 AM
Is there a way for having a "custom maximize" option:

- trapping the maximize command
- get the width and height of the maximized windows
- reduce in 1px both width and height, ie, convert into a not maximized window

when you dont have maximized windows you can move in all open windows without problems.

Can you share a sample for this?  The tabstrip sample isnot we really want.
0
Georgi Tunev
Telerik team
answered on 30 Jul 2009, 10:39 AM
Hello iomega 55,

The tabstrip example, that I posted in my previously reply, simply shows a scenario where changing the z-Index of the window is needed and how to achieve it - that is why I noted to check the OnClientShow and OnClientActivate functions where the approach I was talking about is used.
As for your last question, yes, this is possible. You need to:
  1. Hook to the OnClientCommand eventhandler
  2. Check if the executed command is Maximize and if so - cancel it by using args.set_cancel(true)
  3. Implement the desired behavior by using the client-side API.
More information on the subject is available here:
http://demos.telerik.com/aspnet-ajax/window/examples/clientsideevents/defaultcs.aspx?product=window
http://www.telerik.com/help/aspnet-ajax/window_programmingradwindowmethods.htmlhttp://www.telerik.com/help/aspnet-ajax/window_programmingclientsideevents.html


All the best,
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.
0
iomega 55
Top achievements
Rank 1
answered on 01 Aug 2009, 03:12 PM
I have this code:

function OnClientCommand(sender, args)   
{   
    //alert("Window with ID " + sender.get_id() + " event:<strong> OnClientCommand.</strong>, command: " + args._commandName + " isMax" + sender.isMaximized());  
    switch (args.get_commandName())
    {
        case  "Minimize":
            var bIsMaximized = sender.isMaximized();
            window.setTimeout(function()  
                {
                    fnHideWin(sender.get_id(), bIsMaximized);   
                }, 0 );       
            break;
        case "Maximize":
            window.setTimeout(function()  
            {
                var wWinStyle = sender.get_popupElement().style;
                var wWinH = wWinStyle.height.substring(0,wWinStyle.height.length-2);  //remove px
                var wWinW = wWinStyle.width.substring(0,wWinStyle.width.length-2);
                wWinH = (wWinH - 1);  // reduce 1px
                wWinW = (wWinW - 1);
                //sender.set_width(wWinW);
                //sender.set_height(wWinH);
                sender.setSize(wWinW, wWinH);
                args.set_cancel(true);  
                fnChangeTagMinimize(sender.get_id(), 'm1',  wWinH, wWinW);    //create a span element                                                                       
            }, 0 );  
            break;
    }
}  

What I want it's cancel the maximize option, but after the execution of this code the resulting window doesnt have the height I want, it has the original height of the window, even if the value of the height(the new value) is correct. The icontoolbar for maximized it's activated, as if the window is maximized.

I see this behaviour is present when I have the RestrictionZoneId option in the radwindowmanager, the windows are not working ok when I use setSize, but if I remove this attribue(RestrictionZoneId) all works fine. This is how I have defined the restriction zone:

            <telerik:RadPane ID="sp1Restricted01" runat="server" Width="100%" Height="100%">
                <div id="dvRestricted01" style="border-bottom:1px; border-bottom-color:LightGrey; background-color:red; height:100%;width:100%;">
                    <table class="tbl01">
                        <tr>
                            <td valign="middle" align="center">
                                <br /><br /><br /><br />
                                <img src="../../img/logo.jpg" alt="Logo" />
                            </td>
                        </tr>
                    </table>        
                </div>                
            </telerik:RadPane>





0
Georgi Tunev
Telerik team
answered on 05 Aug 2009, 11:42 AM
Hi iomega 55,

To properly cancel the command, you need to use args.set_cancel(true) in the beginning of your code - otherwise you will have your logic and the internal Maximize functionality working at the same time.

If you still experience problems, please open a support ticket and send full sample project that can be run locally and that reproduces the problematic behavior. We will check it and do our best to help.

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.
Tags
Window
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
iomega 55
Top achievements
Rank 1
Share this question
or