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

RadWindows Tile Property and Overlaps

6 Answers 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Arindam
Top achievements
Rank 1
Arindam asked on 08 Jul 2009, 02:43 PM
Hello Friends -

I am having two problems with Telerik Rad-Windows, please help me where I am going wrong:-

1. Tile Window Property is not working in correct way. I had used the below script -

<asp:ImageButton ID="ImgBtnTile" runat="server" AlternateText="Tile" OnClientClick="GetRadWindowManager().tile();return false;" ImageUrl="~/images/icons/tile.gif"/>

Above code is placed in Master Page and in Content Page I am having the Rad-Windows, but the windows are not properly tiled.
I guessed it should be working exactly same as Tile Windows Vertically/Horizontally property of Windows OS. Please let me know how I can get the functionality correctly done.

2. I am dragging Rad-Windows from a tree-view and dropping it in a div, what I want to do I need to stop overlapping i.e when I dragged one window say RadWindow1 which is showing me http://www.rediffmail.com and I dragged another window say RadWindow2 which is showing me http://www.google.com and when I dropped the second window in div and placed it over the first window then the first or second window will automatically adjust and two windows won't be overlapped. can I have this functionality working?

Please suggest me a possible way to get the above functionality done!

Thanks
Arindam R

6 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 10 Jul 2009, 11:27 AM
Hello Arindam,

In reference to the questions :
  • I am not quite sure but I think that you point the RadWindows' overlapping when the windows are tilled. This behavior occurs when the sum of the windows buttons' width is greater than the width of the browser window. Please note that this behavior cannot be overridden because the RadWindow control cannot shrink its width to a smaller size than the buttons on the top-left corner.
  • Your scenario can be covered but this is a common programming task and you need to implement it yourself. For your convenience I will point the event and the functions related to the RadWindow control that you can use in order to achieve the desired result :
    - OnClientDragEnd - this event is fired when the mouse button is dropped
    getWindowBounds() - Returns the current size and position of the RadWindow
    - moveTo(x, y) - moves the window's client-side object to the specified position

I hope this helps.

Sincerely yours,
Fiko
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
Valery
Top achievements
Rank 2
answered on 08 Jan 2010, 08:06 AM
I have a r.a.d. window and I am trying to save its position after dragging. Unfortunately it seems like getWindowBounds() returns its position before dragging...
0
Georgi Tunev
Telerik team
answered on 13 Jan 2010, 11:40 AM
Hi Valery,

Try calling getWindowBounds() with a small timeout - even a timeout of 0ms should do the trick:
function OnClientDragEnd(sender, args)
{
    window.setTimeout(function()
    {
        var bounds = sender.getWindowBounds();
        alert(bounds.x + "    " + bounds.y);
    }, 0);
}


All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Valery
Top achievements
Rank 2
answered on 13 Jan 2010, 12:37 PM
Привет, Georgi,

Thank you for the solution you have provided. It worked! However such a behavior is kind of weird...

Best regards,
Valery.
0
Raphael
Top achievements
Rank 1
answered on 14 Jul 2010, 11:39 PM
Georgi,

I agree: it is wierd.
0
Georgi Tunev
Telerik team
answered on 16 Jul 2010, 11:47 AM
Hi guys,

I can agree that the logic can be a bit confusing. It is kept for backward compatibility and of course if we find a way to change it without affecting other functionality that depend on it, we will do that.
If you don't want to use a timeout in your calculations, I would suggest to check the approach used in the attached file. There we are using Telerik's static client library for getting the needed size and position.


All the best,
Georgi Tunev
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
Arindam
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Valery
Top achievements
Rank 2
Georgi Tunev
Telerik team
Raphael
Top achievements
Rank 1
Share this question
or