I have a list box where users can select multiple items. 1st option is select all
selectall
Level1 Products
Level2products
Level3Products
Dim Query = (from p in Dc.Products Join O on Dc.Orders On p.ProductId equals O.ProductId
where o.Status = "Delivered" /***Here I need Add Another Condition***/
Select
ProductId = p.ProductId.Tostring(), _
OrderStatus = O.OrderStatus.tostring(),_
OrderNumber = O.OrderNumber(),_
ProductLevel = p.Level())
/***Here I need Add Another Condition***/
Here I need something like if the user selects Select All I need to run the query with Out any condition and return all values
If the user selects Level1 and Leve2 I need to display only those products.
ddlitem.selectedValues.contains(p.level)
Please Don't mark the Question I posted as Answered until I do it.
you can use Or condition with level criteria. i mean ddlitem.selectedValues.contains(p.level)
or ddlitem.selectedvalues.contains(selectall option value)
Sumit Jain
Remember to click Mark as Answer on the post that helps to others.
Marked as answer by krishnada25 on Feb 14, 2013 03:54 PM
krishnada25
Member
633 Points
907 Posts
Linq Condition help - vb.net
Feb 13, 2013 08:09 PM|LINK
I have a list box where users can select multiple items. 1st option is select all
selectall
Level1 Products
Level2products
Level3Products
Thanks,
Kris
sumitjain231
Participant
1496 Points
294 Posts
Re: Linq Condition help - vb.net
Feb 14, 2013 05:46 AM|LINK
you can use Or condition with level criteria. i mean ddlitem.selectedValues.contains(p.level) or ddlitem.selectedvalues.contains(selectall option value)
Remember to click Mark as Answer on the post that helps to others.
krishnada25
Member
633 Points
907 Posts
Re: Linq Condition help - vb.net
Feb 14, 2013 03:54 PM|LINK
I got it resolved. I am adding all the items to a list (ListAll) and doing Listselected where I am adding Only selected items from the dropdown
if ddlitem.selectedIndex = 0, listall.contains(p.level), listselected.contains(p.level)
Thanks,
Kris