RadWindow.Alert behind another RadWindow

3 posts, 1 answers
  1. Kelley Wong
    Kelley Wong avatar
    21 posts
    Member since:
    May 2010

    Posted 10 Dec 2010 Link to this post

    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. Answer
    hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 10 Dec 2010 Link to this post

    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.
  3. DevCraft banner
  4. Afsal
    Afsal avatar
    24 posts
    Member since:
    Dec 2010
Back to Top