Prevent RadWindows.Prompt from exiting.

3 posts, 0 answers
  1. Michael Crump, MVP
    Michael Crump, MVP avatar
    2 posts
    Member since:
    Jan 2010

    Posted 16 Dec 2010 Link to this post

    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. Michael Crump, MVP
    Michael Crump, MVP avatar
    2 posts
    Member since:
    Jan 2010

    Posted 16 Dec 2010 Link to this post

    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;
                }
            }
  3. DevCraft banner
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 20 Dec 2010 Link to this post

    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
Back to Top