Check to see if a RadWindow is already open

2 posts, 0 answers
  1. Abhijit
    Abhijit avatar
    2 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2012 Link to this post

    Hi,

    I am showing a RadWindow on error like this:
    string confirmText = ((TextBox)control).Tag + " is a required field";
                                   RadWindow.Alert(confirmText);

    I am looping through several controls like this and showing a RadWindow for each time a require isnt met.
    I would ideally like to check if an alert is already visible and if it is then dont show anymore alerts.
    How can I check to see if a RadWindow is already open ?
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 07 Mar 2012 Link to this post

    Hello,

    I can suggest you to use the RadWindowManager.Current which gets the singleton instance of the opened window and check if there is already opened one, if not then open a new one, for example:


    private void RadButton_Click(object sender, RoutedEventArgs e) 
            
                MyWindow newWindow = newMyWindow(); 
                var opend = RadWindowManager.Current.GetWindows(); 
                if(opend.Count == 0) 
                
                    newWindow.ShowDialog(); 
                
            }

    Hope this helps.

    Kind regards,
    Konstantina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top