RadWindow Closing problem

6 posts, 1 answers
  1. Shaun
    Shaun avatar
    31 posts
    Member since:
    Jul 2011

    Posted 15 Apr Link to this post

    I am not sure whether this should be classed as a bug or not.

    When using the VisualStudio2013 Dark Theme and closing a RadWindow it "Shrinks" and fades away. However the window is still active whilst it is shrinking.

    In my use case I have a RadWindow as a popup with a RadListBox containing several items. On the RadListBox's SelectionChanged Event some work is carried out and I call Close() on the RadWindow. This happens very quickly and if a user double clicks a RadListBoxItem rather than single clicking the RadWindow it is already closing and the RadListBoxItem below the selected item moves under the curser as the RadWindow "Shrinks". This item then fires the same event.

    As a work around I am going to set IsEnabled=false on all my RadWindows before calling Close() as this fixes the issue.

    I just wondered whether this could effect other peoples projects in different ways, and whether the IsEnabled=false should be set somewhere else within the Telerik code as an automated process.

    Regards,

    Shaun

     

     

  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 18 Apr Link to this post

    Hi Shaun,

    I tested the explained scenario with 2016.1 217 version of the controls, however I couldn't observe that behavior. Can you please check the attached sample project and let me know whether you could reproduce the issue - if so I would like to ask you share a video demonstrating the exact steps to reproduce?

    I'm looking forward to hearing from you.

    Regards,
    Kalin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Shaun
    Shaun avatar
    31 posts
    Member since:
    Jul 2011

    Posted 18 Apr in reply to Kalin Link to this post

    Hi Kalin,

    Yes it is possible to reproduce with your example. Modify the ListBox_SelectionChanged function like below;

    private void ListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
            {
                ListBoxItem lbi = (ListBoxItem) e.AddedItems[0];
                Debug.WriteLine(lbi.Content);
                this.Close();
            }

     

    Then select item 3. If you click again (slightly slower than double click without moving your curser) you can select item 2 as the RadWindow is closing. Your debug output should now show this.

     

    Hope this helps,

     

    shaun

  5. Shaun
    Shaun avatar
    31 posts
    Member since:
    Jul 2011

    Posted 18 Apr in reply to Shaun Link to this post

    An extra note. Just click like made on item 3 until the window has completely disappeared and you will get it changing several times. I managed to get the following output doing this;

    Item 3
    Item 2
    Item 3
    Item 2

     

    Regards,

    Shaun

  6. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 18 Apr Link to this post

    Hi Shaun,

    This is expected - while the closing animation is playing you would be able to click somewhere on the Window. So as a solution you could disable the ListBox or you could show BusyIndicator (it will disable the content and show busy message) before calling the Close method of RadWindow.

    Hope this helps

    Regards,
    Kalin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  7. Shaun
    Shaun avatar
    31 posts
    Member since:
    Jul 2011

    Posted 18 Apr in reply to Kalin Link to this post

    Thanks for looking into this Kalin. I will stick with disabling the window before closing it for now. I just wanted to check that it was expected or not.

     

    Regards,

     

    Shaun

Back to Top
UI for WPF is Visual Studio 2017 Ready