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

DropDown not fully closed

3 Answers 180 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 15 Nov 2016, 04:06 PM

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

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 16 Nov 2016, 09:15 AM
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.
0
Christian
Top achievements
Rank 1
answered on 16 Nov 2016, 09:50 AM

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

0
Dimitar
Telerik team
answered on 16 Nov 2016, 11:27 AM
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.
Tags
MultiColumn ComboBox
Asked by
Christian
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Christian
Top achievements
Rank 1
Share this question
or