How to hide dropdownlist in ComboBox

0 Answers 115 Views
ComboBox
Allen
Top achievements
Rank 1
Iron
Iron
Allen asked on 07 Sep 2022, 04:22 PM

Hey Team, 

I got a question want to ask you about when I added a ComboBox with IsDropDownOpen, OpenOnFocus, ItemsSource, IsEditable, Text properties into a view. As you can see my below code. 

<telerik:RadComboBox 
                     IsDropDownClosedOnSelection="False"
                     ItemsSource="{Binding Items}"
                     DisplayMemberPath="Name"
                     OpenOnFocus="False" 
                     ItemsSource="{Binding Items}"
                     IsEditable="True"
                     SearchTextPath="Name"
                     DisplayMemberPath="Name" 
                     IsDropDownOpen="False"
                     Text="{Binding SearchValue, Mode=TwoWay}"/>

The drop down list always shows me when RadComboBox gets focus. I did more testing on it, I found if we add Text property with TwoWay mode, it always pops up drop down list even though I set the  IsDropDownOpen and OpenOnFocus to False.

I want to confirm do you have a way to hide drop down list if we use Text property with TwoWay Mode? As I want to do more search functionality with RadComboBox.

 

Thanks

Allen

Didi
Telerik team
commented on 08 Sep 2022, 07:27 AM

Hi Allen,

I am not sure I understand the requirement you have.

You want to hide the dropdown but you have set the IsDropDownClosedOnSelection to false.  You have to set the property to true in order to close the dropdown when selection is made. 

On which platform the behavior you described ( if we add Text property with TwoWay mode, it always pops up drop down list even though I set the  IsDropDownOpen and OpenOnFocus to False )can be reproduced? I have tested on android and WinUI and no issues with the drop down 

Allen
Top achievements
Rank 1
Iron
Iron
commented on 08 Sep 2022, 09:51 AM | edited

Sorry for the confusing, please ignore other properties, just add IsDropDownOpen, OpenOnFocus, ItemsSource, IsEditable, you can ignore other properties, just like below code

<telerik:RadComboBox 
                     DisplayMemberPath="Name"
                     OpenOnFocus="False" 
                     ItemsSource="{Binding Items}"
                     IsEditable="True"
                     SearchTextPath="Name"
                     IsDropDownOpen="False"/>

I'm focusing on Window platform. I created this ComboBox with an ItemsSource in ViewModel, when I type a symbol in ComboBox, it always pops up drop down list, I also a reproduce project, please take a look. 

I just want to make sure can we hide drop down list when we type anything in comboBox if we don't want to show it?

Thanks

Didi
Telerik team
commented on 09 Sep 2022, 07:28 AM

Hi Allen,

The ComboBox drop down behaves as expected.

When IsEditable is set to true and the control receives focus the drop down is not visible, when you start typing the DropDown appears, and this is how the control behaves. This is not an issue in the control. This is expected for the ComboBox control and this is by design.

The scenario you are looking can be achieved with AutoComplete control. The control is in development state and if passing testing it will be released in the next official release.

I hope this information was helpful.

Allen
Top achievements
Rank 1
Iron
Iron
commented on 13 Sep 2022, 08:12 AM

Got you. Thank you for kindly explaining

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Allen
Top achievements
Rank 1
Iron
Iron
Share this question
or