Solved

AutoComplete Box Issue

Posted on 2013-10-27
1
437 Views
Last Modified: 2013-10-27
The problem is that when populating the data in a form based on the autocomplete box, it will display the wrong information if the first name and last name are the same even though they are 2 different people with different employee numbers. It works for all other cases. I did some tests and changed first name and also last name and then it will populate the correct user.  So it looks like it is matching on first name and last name but I want it to populate form based on employee number instead of first name+last name.

What to do?
The code below is the particular autocomplete box that is giving me issues.
Also what method is executing when you make the selection in the dropdown list?? I believe this is where the issue may be.

Please help.

<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
 <TextBlock Text="Observer Name" Style="{StaticResource TextBlockLabelStyle}"/>
 <TextBlock Style="{StaticResource TextBlockRequiredFieldIndicator}"/>
 </StackPanel>
 <sdk:AutoCompleteBox Grid.Row="0" Grid.Column="1" x:Name="acbObservers"
 MinimumPrefixLength="1"
 hu:AsyncAutoCompleteBoxService.ItemsSource="{Binding Observers}"
 hu:AsyncAutoCompleteBoxService.PopulateCommand="{Binding PopulateObserversCommand}"
 SelectedItem="{Binding EditingItem.Observer, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True, Converter={StaticResource userToEmployeeConverter}}"
 IsEnabled="{Binding EditingItem.IsNew}">
 <sdk:AutoCompleteBox.ItemTemplate>
 <DataTemplate>
 <StackPanel Orientation="Horizontal">
 <TextBlock hu:TextBlockHighlightService.Text="{Binding FullNameWithEmployeeNumberAndLanID}"
 hu:TextBlockHighlightService.HighlightText="{Binding SearchText, ElementName=acbObservers}"
 Style="{StaticResource TextBlockLabelStyle}"/>
 </StackPanel>
 </DataTemplate>
 </sdk:AutoCompleteBox.ItemTemplate>
 </sdk:AutoCompleteBox>

Open in new window

0
Comment
Question by:mathew_s
1 Comment
 
LVL 1

Accepted Solution

by:
mathew_s earned 0 total points
ID: 39604071
Had to set the valuememberpath to a unique field in the autocompletebox. It then picked up the correct value.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now