I am trying to filter items in a ListView
by using a TextBox
.
I've managed to make something, but it can only delete items from my listview, not bring them back. Here is a little example of my code:
private void textBox1_TextChanged(object sender, EventArgs e)
{
string value = textBox1.Text.ToLower();
for (int i = listView1.Items.Count - 1; -1 < i; i--)
{
if
(listView1.Items[i].Text.ToLower().StartsWith(value) == false)
{
listView1.Items[i].Remove();
}
}
}
Does anybody has an idea on how to retrieve the deleted items? I can't seem to figure it out >:...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…