How to prevent user from dragging RadWindow off the screen

10 posts, 0 answers
  1. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 28 Aug 2009 Link to this post

    Hi,

    I am using the telerik controls version 2009.2.812.1030 for sl3.
    I want to create an MDI like app. (Is there a sample available ?)
    With RadWindow, the user can easily drag a radwindow off the screen and then he cannot drag it anymore because the title part of the radwindow is no longer on screen. What is the advised way to prevent this. Is there maybe a built in method/property?


    Best regards,
    Henri

  2. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 28 Aug 2009 Link to this post

    Sorry, I found the property 'IsRestricted' to prevent the dragging off screen.
    But the behaviour is different from what is done in your demo. Some tips on how to replicate this?
  3. DevCraft banner
  4. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 28 Aug 2009 Link to this post

    Hello Henri,

    We don't have a demo that includes the IsRestricted property in our Quick Start Framework yet. What behavior do you expect from the IsRestricted property? Thank you for contacting us and we look forward to receiving your feedback.

    All the best,
    Hristo Borisov
    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.
  5. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 28 Aug 2009 Link to this post

    Hi Hristo,
    I expected something like being able to drag the windows out of the way so that a part of the header stays on the screen.
    (so the user can still use the header to move the window )
    Now, the restricted property constrains the window so that no part of it can go out of the screen.
     But I think that this limits the user too much when he wants to move one of several radwindows out of the way to make some room.
    Maybe it is unclear what I am trying to say but as an example of a (for me) ideal behaviour can be observed in visual studio when e.g. you drag the output window. You can almost completely drag it of the screen, but not too much, thus allowing the window to be dragged back in place.

    Best regards,
    Henri
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 31 Aug 2009 Link to this post

    Hello Henri,

    I would suggest you to set negative values to the RestrictedAreaMargin property. In this way the user will be able to drag the Window off the screen, but as much as you like to.

    Hope this helps.

    Regards,
    Miroslav Nedyalkov
    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.
  7. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 31 Aug 2009 Link to this post

    Thank you. This helps.
    Best regards,
    Henri
  8. yjh
    yjh avatar
    67 posts
    Member since:
    Aug 2007

    Posted 26 Oct 2009 Link to this post

    Henri said:

        Sorry, I found the property 'IsRestricted' to prevent the dragging off screen.
    But the behaviour is different from what is done in your demo. Some tips on how to replicate this?

    Yes, the url of demo is

    http://demos.telerik.com/silverlight/#Window/FirstLook

    I see the code, it doesn't use IsRestricted and RestrictedAreaMargin property, but still keep not whole radwindow header out of browser,so user can drag it back.

    How to do it whithout using propertys about restricted?
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Oct 2009 Link to this post

    Hi Yoa,

    We didn't do anything in order to prevent the window to go out of the screen. It doesn't go out, because when you drag the mouse out of the Silverlight plugin it stops receiving mouse events. This is because the windowless mode of the examples application is activated.

    All the best,
    Miroslav Nedyalkov
    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.
  10. alvin shih
    alvin shih avatar
    13 posts
    Member since:
    Oct 2009

    Posted 23 Nov 2009 Link to this post

    please elaborate on what do you mean by windowless mode?
    maybe a code sample will do.
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Nov 2009 Link to this post

    Hi Alvin,

    This is a mode of the Silverlight plug. Please refer to the following help article: http://msdn.microsoft.com/en-us/library/cc838156(VS.95).aspx.

    Regards,
    Miroslav Nedyalkov
    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.
Back to Top
DevCraft banner