I have a listview name listView1 and it contains computer id's and their some infos.So what I want to do is I have a textbox name filterbox and when I write something it will filter it,it works fine.My problem is it just look for the first column not the others.For example ;
PCNAME USER MODEL
AAAA JOHN DELL
BBBB MIKE TOSHIBA
CCCC ASH MONSTER
when I type BB it just gets the second row and it works fine but if I type DELL it gets me nothing.
private void filterbox_TextChanged(object sender, EventArgs e)
{
if (filterbox.Text != "")
{
for (int i = listView1.Items.Count - 1; i >= 0; i--)
{
var item = listView1.Items[i];
if (item.Text.ToLower().Contains(filterbox.Text.ToLower()))
{
item.BackColor = SystemColors.Highlight;
item.ForeColor = SystemColors.HighlightText;
}
else
{
listView1.Items.Remove(item);
}
}
if (listView1.SelectedItems.Count == 1)
{
listView1.Focus();
}
}
}