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

Close window with button "X"

7 Answers 580 Views
Window
This is a migrated thread and some comments may be shown as answers.
regis
Top achievements
Rank 1
regis asked on 27 Nov 2009, 08:07 PM
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

7 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 28 Nov 2009, 01:11 PM
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.
0
regis
Top achievements
Rank 1
answered on 01 Dec 2009, 09:28 PM
Hi Miroslav,

Thank you for answering.

I manage to find a work around. It should do the trick, well I hope.
0
Mark
Top achievements
Rank 1
answered on 11 Feb 2013, 04:44 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 15 Feb 2013, 12:29 PM
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.

0
Mark
Top achievements
Rank 1
answered on 15 Feb 2013, 04:35 PM
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

0
Miroslav Nedyalkov
Telerik team
answered on 18 Feb 2013, 12:46 PM
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.

0
Mark
Top achievements
Rank 1
answered on 21 Feb 2013, 02:35 PM
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.
Tags
Window
Asked by
regis
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
regis
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Share this question
or