RadWindow Close with Esc Key

7 posts, 0 answers
  1. Ravi Gorrepati
    Ravi Gorrepati avatar
    5 posts
    Member since:
    Aug 2008

    Posted 22 Aug 2008 Link to this post

    Hi, help me
    i am using teleric radwindow as a modal popup.
    My requirement is Radwindow should close when the user press ESC key from keyboard. radwindow does not have any close() method.  what cod ei have to write.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 22 Aug 2008 Link to this post

    Hi Ravi,

    If RadWindow is not modal (e.g. Modal=true), it will be closed if the user presses the Esc key - you can check this on our online demo (note that the RadWindow must be focused for Esc to work - e.g. you need to click on the RadWindow's titlebar if the focus is somewhere else).

    If you wish to close RadWindow by code, RadWindow has a close() method. More information on it and its usage is available in the documentation.


    Kind regards,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ravi Gorrepati
    Ravi Gorrepati avatar
    5 posts
    Member since:
    Aug 2008

    Posted 22 Aug 2008 Link to this post

    Hi,

    Thanks for u r reply.
    but i am using Radwindow as Modal. (Modal=true),
    in this case how to close it with ECS key press.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 25 Aug 2008 Link to this post

    Hello Ravi,

    In such case you will need to capture the Esc key and if it is pressed and there is a RadWindow active on the page, you can get a reference to it and call its close() method.

    Since this task is not directly related to RadWindow but is a general one, my suggestion is to implement your logic by using window.open() - e.g. standard browser's popup. Once you have your code working as expected, the same logic will work with RadWindow as well.




    Best wishes,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Justyn
    Justyn avatar
    13 posts
    Member since:
    Sep 2010

    Posted 02 Nov 2010 Link to this post

    Here is a Link to the demo for those who found this through searching.
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Nov 2010 Link to this post

    Hi Justyn,

    Yes, this is a new functionality that was recently added to the RadWindow features list.

    Best wishes,
    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
  8. Dinesh
    Dinesh avatar
    1 posts
    Member since:
    Nov 2014

    Posted 06 Jan Link to this post

    RadWindow1.Shortcuts.Add("Close", "Esc");
    or
    RadWindow1.Shortcuts.Add(new Telerik.Web.UI.WindowShortcut("Close", "Esc");
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017