Skip to main content

Microsoft Silverlight

Answered Question What is the AutoCompleteBox event for selection?RSS Feed

(0)

mkadlec
mkadlec

Member

Member

2 points

8 Posts

What is the AutoCompleteBox event for selection?

The AutoCompleteBox is working great for a staff picking textbox I have in my application.  There is however, additional logic I would like to add once the user selects a staff member.

 This is where I am stumped.  I need an event that fires once the user scrolls down the selection and actually selects a staff member.  I thought if I set the  IsTextCompletion property to false and then used the Populated property that would do it, but unfortunately the Populated property fires ever time the user his the down arrow on the selection list.

 I've included my XAML below, what event should I use?  Is there one for this?

         <input:AutoCompleteBox x:Name="uxAuto"
                               Margin="20,1,2,1"
                               FontSize="9"
                               HorizontalAlignment="Left"
                               Height="20"
                               FilterMode="Custom"
                               ToolTipService.ToolTip="Enter Staff Info"
                               ValueMemberPath="DisplayValue"
                               Populated="uxAuto_Populated"
                               SelectionChanged="uxAuto_SelectionChanged"
                               MinWidth="180">
            <input:AutoCompleteBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=StaffId}" Margin="0,0,5,0" />
                        <TextBlock Text="{Binding Path=FullName}" />
                    </StackPanel>
                </DataTemplate>
            </input:AutoCompleteBox.ItemTemplate>
        </input:AutoCompleteBox>

 

 

 

mkadlec
mkadlec

Member

Member

2 points

8 Posts

Answered Question

Re: What is the AutoCompleteBox event for selection?

 After playing around with it, I was able to use the DropDownClosed event, seems to fit the bill.

 Not sure if that is the recommended solution but I'll use for now.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities