Close window with button "X"

8 posts, 1 answers
  1. regis
    regis avatar
    44 posts
    Member since:
    May 2009

    Posted 27 Nov 2009 Link to this post

    Hi everyone,

    I am wondering if there is a way to know if the user close a window using the "X" button. I assume it's in the previewclosed event but what should i check in that event?

    thank you
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Nov 2009 Link to this post

    Hello Regis,

    Currently the RadWindow control doesn't support such feature out-of-the-box. Could you please give us some more details what do you need and we will think about a work-around how to find this information.

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. regis
    regis avatar
    44 posts
    Member since:
    May 2009

    Posted 01 Dec 2009 Link to this post

    Hi Miroslav,

    Thank you for answering.

    I manage to find a work around. It should do the trick, well I hope.
  5. Mark
    Mark avatar
    12 posts
    Member since:
    Jan 2013

    Posted 11 Feb 2013 Link to this post

    In the latest version of WPF telerik (2012 Q3), is there now a way to know if the user close a window using the "X" button on a RadWindow?

    Thank you
    Mark Lovell
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 15 Feb 2013 Link to this post

    Hello Mark,

    The RadWindow control doesn't support such feature in the 2012 Q3 release and it is not in our roadmap yet. Could you please give us more information about the scenario in which you need this information? Having this details will help us log this as a feature request in PITS and let the clients vote for it.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Mark
    Mark avatar
    12 posts
    Member since:
    Jan 2013

    Posted 15 Feb 2013 Link to this post

    The "X" to close a window is standard in windows so people expect to see it (althougth I could hide it through XAML). The standard windows processing is that when the X is clicked, the behaviour is the same as clicking a Cancel button (which might trigger a prompt to save ... )

    Currently I do not know of a way to detect the click of the X so I cannot not make a RadWindow behave as a standard Windows window. The only option is to remove the X and force the user to click on cancel. So I am not asking for a non-standard feature, I am just asking that RadWindow support standard Window behaviour.

    Or if there is an event (such as Closing) that can identify to me that the window is being cancelled (by the X) so I can stop the closing depending on a user prompt.

    Am I missing an existing feature?

    Thank you
    Mark

  8. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 18 Feb 2013 Link to this post

    Hello Mark,

    When the RadWindow is closed with either the "X" button or with the Alt+F4 combination, the Closing event is fired. It is fired even if you close the window using the Close method or throwing the Close command. You can use the Closing event for detecting the case of closing the RadWindow control.

    Hope this helps.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  9. Mark
    Mark avatar
    12 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    Ok thank you.

    I did not find a Closing event, but I overrode OnClosing(). I use it to determine if they had clicked OK or not. I returned false to prevent the closing when needed.
Back to Top
UI for WPF is Visual Studio 2017 Ready