0

Can loop through selected items using "SelectedItems.Count" & "SelectedItems(i)". Can loop through all items using "Items.Count" & "Items(i)". How best reverse IsSelected of each Items(i) when IsSelected property is not available?

(Note: Becuase ListBox is data-templated and data-bound, each Items(i) is a DataRowView and not a ListBoxItem.)

4

1 回答 1

-1

遍历所有项目:

Foreach(ListBoxItem Item in CustomerListBox.Items)
(
    Item.Selected = IIf(Item.Selected, false, true)
)
于 2013-06-18T22:28:35.920 回答