我正在为 Windows 8 开发应用程序,我想在 GridView 中选择多个项目(通过 c# 代码),我试过这个:
第一
for (int i = 0; i <= 2; i++)
{
this.ItemGridView.SelectedIndex = i;
}
//in this way is only selects the third element
第二
this.ItemGridView.SelectedItem = listPeople;
//in this way does not select anything
第三
foreach (Persona persona in listaPersone)
{
this.ItemGridView.SelectedItem = person;
}
//in this way is selected only the last