Hello,
I have an application that has multiple groups and within each group there is a list of items.
I have a search box and I want to put in a string and have it return the matching items in both groups.
I am using this as the resource -
http://msdn.microsoft.com/en-us/library/ms171644(v=vs.90).aspx
VulpesPosted May 4, 2014, 6:13 PM
Agile DeveloperPosted May 4, 2014, 6:39 PM
Agile DeveloperPosted May 4, 2014, 3:43 PM
http://www.dreamincode.net/forums/topic/124976-search-for-items-in-listview/
The issue I am having is that I have to define the search term within my code.
I want to be able to click the search box and enter my search string.
Here is the code -
private void button1_Click(object sender, EventArgs e)
{
SearchTextInListView(listView1, "test");
}
private static void SearchTextInListView(ListView lst, string Search)
{
string iSearch = Search.ToLower();
foreach (ListViewItem item in lst.Items)
{
if (item.Text.ToLower().Contains(iSearch))
{
item.Selected = true;
}
}
}
//This is the search box
private void _tsbSearch_TextChanged(object sender, EventArgs e)
{
}
Thanks