I have a gridview which has drop down boxes in each header for filtering. Each filter is loaded with the distinct values from its column when loaded. At run time, I add \"AL
You could create a helper method that handles the All logic. Something like:
private bool CompareSelectedValue(string value, string dropDownValue)
{
if(dropDownValue == "ALL")
return true;
else
return value == dropDownValue;
}
Then your query could be:
var filteredList = (from x in allQuotes
where (CompareSelectedValue(x.SalesRepFullName, drpOwners.SelectedValue)
&& CompareSelectedValue(x.CompanyName, drpCompanyName.SelectedValue)
select x);