Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When selecting an item in the combobox list, the user can start typing the first few letters of the name and the combobox narrows the selection accordingly. It also shows another drop down menu of items that may match the user's selection. (suggest feature of autocomplete)
if the user uses the arrow keys to move down the suggested list then presses down key; (the logical thing to do to confirm a suggested selection), the text inside the combo box selected rather than the selected item.

any idea how to disable down key working in dropdownlist of combo box?


view this image link https://onedrive.live.com/redir?resid=908945FCED33300B!106&authkey=!AFgp787Zo7CZTnI&v=3&ithint=photo%2cpng[^]
here result is shown in auto-complete suggestion.when
I press down key record in combo box dropdown list selected
rather than the auto-complete suggestion.
Posted
Updated 3-Dec-14 22:42pm
v4
Comments
TheRealSteveJudge 4-Dec-14 3:44am    
Without more details, nobody can understand your question.
Please show us XAML and its code behind.

1 solution

Use onkeydown event

XML
<asp:DropDownList ID="DropDownList1" runat="server" onkeydown="return false;">
            <asp:ListItem>a</asp:ListItem>
            <asp:ListItem>b</asp:ListItem>
            <asp:ListItem>c</asp:ListItem>
        </asp:DropDownList>


in C# windows Application

C#
private void comboBox1_KeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = true;
        }
 
Share this answer
 
v2
Comments
ranjeet11 4-Dec-14 6:25am    
i want code for windows application
Praveen Kumar Upadhyay 4-Dec-14 6:42am    
check out the solution. I have added for windows application as well.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900