M
Magus
I have a listview with around a 1000 items. I'm using the following
code to filter the list:
private void Filter(string value)
{
for (int i = listView1.Items.Count - 1; -1 < i; i--)
{
if
(listView1.Items.SubItems[1].Text.StartsWith(value) == false)
{
listView1.Items.Remove();
}
}
The problem is that I have no way to restore the old contents of the
listbox. I've tried using:
ListViewItem[] listarray = new ListViewItem[ListView1.Items.Count];
What happens though is that I get an error explaining that the items
can't exist twice. So I looked up some information about using Clone()
but I can't seem to find a method to use it in.
Any help would be appreciated. I'm basically just trying to copy the
contents, and revert when the user has found the info he's looking for.
code to filter the list:
private void Filter(string value)
{
for (int i = listView1.Items.Count - 1; -1 < i; i--)
{
if
(listView1.Items.SubItems[1].Text.StartsWith(value) == false)
{
listView1.Items.Remove();
}
}
The problem is that I have no way to restore the old contents of the
listbox. I've tried using:
ListViewItem[] listarray = new ListViewItem[ListView1.Items.Count];
What happens though is that I get an error explaining that the items
can't exist twice. So I looked up some information about using Clone()
but I can't seem to find a method to use it in.
Any help would be appreciated. I'm basically just trying to copy the
contents, and revert when the user has found the info he's looking for.