Activate ComboDropDown.PopupContainer through PreviewKeyDown Event

I have a ComboDropDown that contains a TreeView as the PopupControl. I want to be able to open the ComboDropDown and display the TreeView programatically by using the PreviewKeyDown or another KeyPress Event, when the user presses the Down Arrow on the keyboard.

PopupContainer.ShowPopup(control.Location) doesn't seem to work. Below are other options I've tried:

- PopupContainer.Show()

- PopupContainer.Controls[0].Select

- PopupContainer.Select()

- PopupControl.Select()

- TreeView.Select()


2 Replies

AN Adrian Negrillo December 12, 2024 03:27 AM UTC

Found a solution through: https://support.syncfusion.com/kb/article/1814/how-to-catch-the-arrow-keys-of-a-combodropdown-control

Implemented a new class deriving from ComboDropDown and did an override of OnPreviewKeyDown.
I just added ShowPopup() into the method and now when the control is focused, if the user pressed the KeyDown it will open the popup.



BS Bhaskar Suresh Syncfusion Team December 12, 2024 06:36 AM UTC

Hi Adrian Negrillo,


We are glad that the reported query has been resolved. Hence, we are marking this forum as closed.

Please get in touch with us if you require any further assistance.


Regards,

Bhaskar Suresh


Loader.
Up arrow icon