DropDown not fully closed

4 posts, 0 answers
  1. Christian
    Christian avatar
    22 posts
    Member since:
    May 2012

    Posted 15 Nov 2016 Link to this post

    Hello

    I've a problem, see attached code.

    If you open the second form and open the combobox and then click on the group (dropdown is not closed because of the dropdown closing event) and then close the form. The dropdown "hovers" without any form/control.

    Kind Regards,

    Christian

  2. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 16 Nov 2016 Link to this post

    Hi Christian,

    Thank you for writing.

    You can cancel the forms closing if the popup is still opened as well:
    protected override void OnClosing(CancelEventArgs e)
    {
        base.OnClosing(e);
        if (radMultiColumnComboBox1.MultiColumnComboBoxElement.IsPopupOpen)
        {
            e.Cancel = true;
            RadMessageBox.Show("You must select valid value");
        }
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. Christian
    Christian avatar
    22 posts
    Member since:
    May 2012

    Posted 16 Nov 2016 in reply to Dimitar Link to this post

    Hello Dimitar,

    thank you, for this workaround. 

    I think this behavior should be fixed, since there are other cases where it works like expected. E.g. the control becomes invisible while the popup is opened (then the popup is closed automatically).

    Kind Regards,

    Christian

  4. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 16 Nov 2016 Link to this post

    Hello Christian,

    The drop down is not closed because the operation is canceled in the DropDownClosing event. It is up to you to manage the possible scenarios in this case and make sure that the user cannot perform an invalid operation.

    Another approach would be to always close the drop down when the form is closed:
    protected override void OnClosed(EventArgs e)
    {
        this.radMultiColumnComboBox1.DropDownClosing -= radMultiColumnComboBox1_DropDownClosing;
        this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ClosePopup();
        base.OnClosed(e);
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top