i want to filter items from listbox as some character typed in combobox ??
suppose when i type "M" in combobox then listbox filter its itemlist which contains
"M" in C# without using SQL STATEMENT...
below is my code.....
private void FillListBoxes()
{
int count = FillList.Rows.Count;
for (int k = 1; k <= count; k++)
{
var itemList = lbSearch.Items.Cast().ToList();
if (count > 0)
{
lbSearch.Items.Clear();
//filtertheitemsandaddthemtothelist
lbSearch.Items.AddRange(itemList.Where(i => i.Contains(cStockTypeName.Text)).ToArray());
lbSearch.Items.Add(FillList.Rows[k]["CatName"].ToString());
}
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bhuvanesh MohankumarPosted May 29, 2016, 6:59 AM