Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

AutoComplete Box Issue

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

791 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