bind to textblock in listbox selected item in wpf
-
Hi I have bind a listbox using <ListBox x:Name="listOrders" ItemsSource="{Binding AllOrders, Mode=OneWay}"> now I have various textbolck inside listbox now i want to bind a textblock outsite the listbox so that it points to listbox selected item text block like this <TextBlock Text="{Binding ElementName = listOrders,Path=SelectedItem.????}" Foreground="White" VerticalAlignment="Center"/> so what i put on SelectedItem.???? please help
-
Hi I have bind a listbox using <ListBox x:Name="listOrders" ItemsSource="{Binding AllOrders, Mode=OneWay}"> now I have various textbolck inside listbox now i want to bind a textblock outsite the listbox so that it points to listbox selected item text block like this <TextBlock Text="{Binding ElementName = listOrders,Path=SelectedItem.????}" Foreground="White" VerticalAlignment="Center"/> so what i put on SelectedItem.???? please help
Well, "SelectedItem" will give you the order that's selected... So what property of that order do you want to display?
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)