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

RadWindow.Alert behind another RadWindow

2 Answers 185 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kelley Wong
Top achievements
Rank 1
Kelley Wong asked on 10 Dec 2010, 08:22 AM
I have a Radwindow
when i check the error ,i use RadWindow.Alert to show me the error

First i use a RadWindow(parent) which contains a GridView to show datasource
Then select some records and click the delete button named  toolbarDeleteThemeObj, the click event as follows

private void toolbarDeleteThemeObj_Click(object sender, RoutedEventArgs e)
        {
            RadWindow.Confirm(CommonResource.ConfirmDeleteNotRecoveredPrompt, new EventHandler<WindowClosedEventArgs>(OnObjectiveThemeWindowClosed));
        }

private void OnObjectiveThemeWindowClosed(object sender, WindowClosedEventArgs e)
        {
            if (e.DialogResult == true)
            {
                if(SelectedItem.Count<=0)
                {
                    RadWindow.Alert("No Record Selected");
                    return;
                }
                  
                //sth other
            }
        }

RadWindow.Confirm shows correctly,but

the bug is RadWindow.Alert  show behind the parent RadWindow ,so i must close the parent RadWindow to see the error RadWindow.

2 Answers, 1 is accepted

Sort by
0
Accepted
hwsoderlund
Top achievements
Rank 1
answered on 10 Dec 2010, 02:02 PM
I have struggled a lot with issues like this in the past. It seems that they are inevitable in certain situations with multi-window applications. Especially when opening windows from the WindowClosed event handler of another window, like you do here. The workaround that I always use is to dispatch the opening of the window. Change this:
RadWindow.Alert("No Record Selected");

To this:
Dispatcher.BeginInvoke(() => RadWindow.Alert("No Record Selected"));

And see if it helps.
0
Afsal
Top achievements
Rank 1
answered on 13 Dec 2010, 02:30 PM
Tags
Window
Asked by
Kelley Wong
Top achievements
Rank 1
Answers by
hwsoderlund
Top achievements
Rank 1
Afsal
Top achievements
Rank 1
Share this question
or