WPF: Editable ComboBox; how to make search/auto-fill functionality case sensitive?

Posted by unforgiven3 on Stack Overflow See other posts from Stack Overflow or by unforgiven3
Published on 2010-04-30T14:02:35Z Indexed on 2010/04/30 14:17 UTC
Read the original article Hit count: 305

Filed under:
|
|
|

Say I have a ComboBox, like so:

<ComboBox IsEditable="True" Height="30">
    <ComboBoxItem>robot</ComboBoxItem>
    <ComboBoxItem>Robot</ComboBoxItem>
</ComboBox>

If a user comes along and starts by typing a lower-case 'r' into that ComboBox when it is empty, the ComboBox predictably auto-fills itself with the word 'robot'. Great.

Now the same user comes along and starts typing an upper-case 'R' into that ComboBox when it is again empty. Unpredictable, the ComboBox auto-fills itself with the lower-case word 'robot'. Not great. I desperately want it to auto-fill itself with 'Robot', but WPF does not seem to want to smile down upon me.

No matter what you do (CAPS lock, shift+key), the ComboBox will always auto-fill with the lower case 'robot', provided that the lower case 'robot' precedes the upper case 'Robot' in the ComboBox's items collection.

Is there any way to prevent this? This behavior is maddening and makes for an absolutely abysmal user experience.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about autofill