WPF MultiColumnComboBox Open DropDown on Focus?

1 Answer 63 Views
ComboBox General Discussions MultiColumnComboBox
Leslie
Top achievements
Rank 1
Leslie asked on 03 Oct 2023, 09:05 PM
Hello, Im using a MultiColumnComboBox and I was wondering if there is a way to click anywhere in the combobox and open the dropdown? I tried combobox.OpenDropdown on GotFocus() but it didn't work. Currently it only opens the dropdown if I click in the button or OpenDropDownOnInput, but there is still a big blank space that does nothing if I click.

1 Answer, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 04 Oct 2023, 02:58 PM

Hello Leslie,

To achieve this requirement, you can subscribe to the MouseLeftButtonDown event of the RadMultiColumnComboBox control.

<telerik:RadMultiColumnComboBox x:Name="radMultiColumnComboBox"
                                MouseLeftButtonDown="radMultiColumnComboBox_MouseLeftButtonDown" />

Then in the code behind you can use the OpenDropDown and CloseDropDown methods of RadMultiColumnComboBox .

private void radMultiColumnComboBox_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
	if (radMultiColumnComboBox.IsDropDownOpen)
	{
		radMultiColumnComboBox.CloseDropDown();
	}
	else
	{
		radMultiColumnComboBox.OpenDropDown();
	}
}

In addition to this I prepared a sample solution where this logic is implemented.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ComboBox General Discussions MultiColumnComboBox
Asked by
Leslie
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Share this question
or