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

[Solved] Prevent RadWindows.Prompt from exiting.

2 Answers 136 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Crump, MVP
Top achievements
Rank 2
Michael Crump, MVP asked on 16 Dec 2010, 04:36 PM
Basically, I want the RadWindow.Prompt to prevent the user from exiting the screen if the password does not matches. Right now it will close the alert box regardless if they enter the right password or not.

My code is below:

RadWindow.Prompt("Please enter your password to continue", new EventHandler<WindowClosedEventArgs>(OnClosed));
       
private void OnClosed(object sender, WindowClosedEventArgs e)
        {
            if (e.PromptResult == "mike")
            {
                //PREVENT Alert Dialog box from exiting if the result does not equal mike
                return;
            }
        }

2 Answers, 1 is accepted

Sort by
0
Michael Crump, MVP
Top achievements
Rank 2
answered on 16 Dec 2010, 04:56 PM
I created this work around for the time being.

RadWindow.Prompt(
"Please enter your password to continue", new EventHandler<WindowClosedEventArgs>(OnClosed));
 
private void OnClosed(object sender, WindowClosedEventArgs e)
        {
            switch (e.PromptResult)
            {
                case "pw1":
                    BolSuperAdmin = false;
                    return;
                case "pw2":
                    BolSuperAdmin = true;
                    btnRefreshXML.Visibility = Visibility.Visible;
                    return;
                default:
                    RadWindow.Prompt("Please enter your password to continue!", OnClosed);
                    break;
            }
        }
0
Konstantina
Telerik team
answered on 20 Dec 2010, 04:29 PM
Hi Michael,

We are glad that you have found a solution yourself.

Please let us know if you have any other questions about our controls.

All the best,
Konstantina
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Window
Asked by
Michael Crump, MVP
Top achievements
Rank 2
Answers by
Michael Crump, MVP
Top achievements
Rank 2
Konstantina
Telerik team
Share this question
or