Q:

Accessing to a ListView at runtime to update an item

I have to update a ListView item by clicking on a button. How do I find and update one at the runtime?
update: I mean I have to find the certain ListView item and update the text of this item only.

A:

When ListViewItems were added to the ListView manually, you can look them up by their content and replace with new content like this (using System.Linq):
object contentToReplace = ...;
object newContent = ...;
ListViewItem item = listView.Items.Cast<ListViewItem>().FirstOrDefault(
    lvi => lvi.Content == contentToReplace);
if (item != null)
{
    item.Content = newContent;
}

