kev3kev3
kev3kev3

Reputation: 395

WPF replacing a specific ListView item

Is there anyway of removing an item at a specific index in a listView and replacing that item with a new item at that specified index.

I can call ListView.Items.RemoveAt(index);

But I cant find a way to replace the item at that index.

Any help here would be hugely appreciated.

Upvotes: 0

Views: 1204

Answers (1)

Sayse
Sayse

Reputation: 43300

You should be able to use insert.

ListView.Items.RemoveAt(index);
ListView.Items.Insert(index, item);

Also untested but I don't see why ListView.Items[index] = ... shouldnt work

Upvotes: 5

Related Questions