Thursday, May 30, 2013

Listview SelectedItem

This is because you have used Element binding but did not give path of property



<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ListView x:Name="MyListView" Grid.Column="0" ItemsSource="{Binding WebServiceDataCollection}">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding UserName}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackPanel Grid.Column="1">
<TextBox Text="{Binding ElementName=MyListView, Path=SelectedItem.UserName }"/>
</StackPanel>
</Grid>






-- Vishal Kaushik --


Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you.


Happy Coding!!!



No comments:

Post a Comment