0
votes

I have a WPF Combo Box which is editable by setting

IsEditable="True"

When the focus is on the text box in the combo and when I click on down arrow, it does not go to the first item in the drop down list. How do I do that?

1
You mean the "down" arrow makes the PopUp display though instead you wish it to go to next item in list?dev hedgehog
Is the textbox empty? Because why do you think it should 'go to the first item' (presumably, hightlight and select the first item)? Based upon what you wrote, it's doing what it's supposed to do.Gayot Fow

1 Answers

1
votes

The behaviour that you describe is the default behaviour of the ComboBox. If you have a ComboBox that does not display this behaviour, I suggest to you that it is your code that is stopping it. If you use this simple example, you will see that this ComboBox works as you wanted:

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
    <ComboBox IsEditable="True" Height="25">
        <ComboBoxItem>Item one</ComboBoxItem>
        <ComboBoxItem>Item two</ComboBoxItem>
        <ComboBoxItem>Item three</ComboBoxItem>
        <ComboBoxItem>Item four</ComboBoxItem>
    </ComboBox>
    <TextBox HorizontalAlignment="Center" Width="100" Margin="0,5,0,0" />
</StackPanel>

The TextBox is just there so we can tab off the ComboBox and back on again. It all works as expected.