I have a listbox that has a List assigned as datasource:
List<String> files = new List<String>();
files.Add("test");
files.Add("test2");
ListBox1.DataSource = files;
Now the listbox shows me both entries of the List.
Is there a way to implement an easy filtering mechanism using a textbox?
So if i enter “2” into the textbox just the “test2” entry should be shown anymore.
Any suggestions?
You can filter List like this:
and than assign filteredFiles as DataSource
Hope this helps.
Edit:
Try this:
or
Sorry, it has been a while since I did a databinding in asp.net 😀