Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » Forum » x-Forum » Question

How to bind DataTemplate of AutoCompleteBox from ListBox?

                                IsTextCompletionEnabled="True"
                                FilterMode="Contains"
                                ItemsSource="{Binding DataContext.LoadedHorses, RelativeSource={RelativeSource AncestorType=ListBox}}"
                                Text="{Binding Path=HorseName, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
                                Height="20"
                                Width="130">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock
                                                Text="{Binding Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>

Posted by sanjay.vaniya 2019-05-15 02:01:55

No Ans Posted

Please login to comment

Log In


Ask New Question