How can I select a CheckBox inside a ListView via code?
I found some code online to check the boxes but checked property is not available in windows phone 8.1
foreach (ListViewGroup grp in listFiles.Groups)
{
foreach (ListViewItem item in grp.Items)
{
if (item.Index != 0)
{
item.Checked = true;
}
}
}
the xaml code is
<ListView x:Name="ContentListView" SelectionMode="Multiple">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="Black" Text="{Binding}" FontSize="25"></TextBlock>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
The checkboxes are automatically generated checkboxes of listview
Checkedproperty is available onCheckBox, in this code you are however iteratingListViewItems, notCheckBoxes. Without your view (e.g. XAML) it's impossible to guess where yourCheckBoxesreally are.