Vote count:
0
I'm creating a windows 8.1 phone app and I have data from a webservice that is the datasource for a grid. The problem I am having is when I click on one of the checkboxes, it is a two binding so the IsChecked property should be getting updated but it isn't. When I access the datasource, it is giving me the same data when it first loads the grid and the checkboxes stay checked. Here is the xaml code and below that is the code where it loads the datasource. What am I doing wrong?
<ScrollViewer Grid.ColumnSpan="5" Grid.Row="3" Height="330" x:Name="scrollControl">
<ItemsControl Name="lstTop10Picks">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="6" Name="gridTop11Stocks">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<CheckBox Style="{StaticResource CheckStyle}" IsChecked="{Binding IsChecked, Mode=TwoWay}" Grid.Column="0" Grid.Row="3">
<CheckBox.RenderTransform>
<ScaleTransform ScaleX="0.5" ScaleY="0.5" />
</CheckBox.RenderTransform>
</CheckBox>
<TextBlock Style="{StaticResource NumberStyle}" Grid.Column="1" Grid.Row="3" Text="{Binding Id}" />
<TextBlock Style="{StaticResource SummaryStyle}" Grid.Column="2" Grid.Row="3" Text="{Binding Symbol}" HorizontalAlignment="Left" />
<TextBlock Style="{StaticResource SummaryStyle}" Grid.Column="3" Grid.Row="3" Text="{Binding Market}" />
<TextBlock Style="{StaticResource SummaryStyle}" Grid.Column="4" Grid.Row="3" Text="{Binding Return}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
var stocks = doc.Element(ns + "ArrayOfStockRating").Elements(ns + "StockRating")
.Select(n => new
{
Id = count += 1,
Symbol = n.Element(ns + "Symbol").Value,
Market = n.Element(ns + "Market").Value,
Return = n.Element(ns + "ShortRating").Value,
IsChecked = false
})
.ToList();
lstTop10Picks.ItemsSource = stocks;
asked 1 min ago
Aucun commentaire:
Enregistrer un commentaire