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

Check to see if a RadWindow is already open

1 Answer 269 Views
Window
This is a migrated thread and some comments may be shown as answers.
Abhijit
Top achievements
Rank 1
Abhijit asked on 06 Mar 2012, 10:11 PM
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 ?

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 07 Mar 2012, 10:14 AM
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 >>
Tags
Window
Asked by
Abhijit
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or