Solved

AutoComplete Box Issue

Posted on 2013-10-27
1
432 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

14 Experts available now in Live!

Get 1:1 Help Now