Solved

AutoComplete Box Issue

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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