Searching In ComboBox Through LINQ (C#.net):
The following code shows you search string in combobox through LINQ.
Code
using System.Linq;
IEnumerable<Object> query =
from Object item in comboBox1.Items
where (item.ToString().ToUpper().Equals(textBox1.Text.ToUpper()))
select item;
foreach (Object obj in query)
{
comboBox1.SelectedItem = obj;
MessageBox.Show("Found");
}
1 comments:
Good work! This was just what I was seeking.
Post a Comment