Maybe I'm doing something wrong

Mar 15, 2015 at 7:52 AM
'ello

First off, very nice and useful control.

I have one question though...
When I select a valid value, my SelectedItem property is bound as expected, but when I then update the text to an invalid value and tab out of the textbox, my SelectedItems stays the previous valid value - I would expect it to be null.

Am I doing somethimg wrong, or is this the expected behaviour?

Thanx
Hein
Mar 15, 2015 at 12:26 PM
Also if possible, when you type in the textbox until only one item is available, and you then tab out of the textbox. Can it maybe select that item without you having to press down and highlighting the item?

Thanx again
Hein
Mar 16, 2015 at 8:20 AM
Regading my first post.

I was doing something wrong :) It was the required validation rule in your example that prevented the property from being set to null.

Thanx
Hein
Coordinator
Mar 17, 2015 at 5:51 AM
For your second question:
In AutoCompleteTextBox.cs file, go to DisplaySuggestions method and
if (_actb.ItemsSelector.HasItems)
                        _actb.ItemsSelector.SelectedIndex = 0;
just below
_actb.IsDropDownOpen = _actb.ItemsSelector.HasItems;
Hope it helps :)

Cheers!
Deepak
Marked as answer by deepdotnet on 3/18/2015 at 10:39 PM
Mar 17, 2015 at 7:10 AM
Thanx Deepak!

Works great :)