Quantcast
Channel: LINQ to XML query from multiple ListBox items - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Jeff Mercado for LINQ to XML query from multiple ListBox items

$
0
0

Try changing your where clause like so:

.Where(b => lbxItems.Items    .Cast<ListItem>() // needs a cast    .Where(i => i.Selected)    .Select(i => i.Value)    .Contains(b.Element("Category").Value))

The idea is to determine what items are selected and see if your category value is among those selected.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>