vb.net - LINQ Query for filter by Selected Items in Checkbox List -
could not find through google or in questions...
i have checkbox listbox on form. want filter list list of selected ids listbox checked, in sql have done "where typeid in (1, 4, 5, 7)"... how do in linq?
i feel missing obvious answer, cannot it.
for argument sake... here have sample data:
in colors (list<of currentcolors>) id, name, typeid 1, red, 1 2, blue, 1 3, green, 2 4, pink, 3
selected types 2 , 3 in checkboxlist: filteredcolors
filteredresults = (from c in workitemmonitor ????).tolist()
expected items in filteredresults be: [3, green, 2], [4, pink, 3]
edit: current query.. (sorry told list, turns out datatable filtering)
dim workitemslisting datatable workitemslisting = (from l in workitemmonitor.asenumerable() _ clbstatus.checkeditems.contains(l.item("currentstatusid"))).copytodatatable()
list<currentcolor> colors = chklistcurrentcolors.checkeditems.cast<currentcolor> (); filteredresults = (from c in workitemmonitor colors.contains(c.typeid)).tolist()
that's best can description. if need more help, you'll need show how add checkedlistbox , type of colors.
Comments
Post a Comment