вы можете попробовать вот так .....
ПРИМЕЧАНИЕ: это всего лишь пример того, как фильтровать представление сетки с выбранными значениями в двух выпадающих списках ...
<%@ page autoeventwireup="true" codefile="FilterWithMultipleDropDownLists.aspx.cs"
inherits="GridView_FilterWithMultipleDropDownLists" language="C#" masterpagefile="~/MasterPages/Default.master"
title="GridView: Filter With Multiple DropDownLists" %>
<asp:content id="Content1" runat="Server" contentplaceholderid="ContentPlaceHolder1">
<div>
Select Supplier:
<asp:dropdownlist id="ddlSuppliers" runat="server" appenddatabounditems="True" autopostback="True"
datasourceid="sdsSuppliers" datatextfield="CompanyName" datavaluefield="SupplierID">
<asp:listitem text="All Suppliers" value="-1">
</asp:listitem>
</asp:dropdownlist>
<asp:sqldatasource id="sdsSuppliers" runat="server" connectionstring="<%$ ConnectionStrings:NorthwindConnectionString %>"
selectcommand="SELECT [SupplierID], [CompanyName] FROM [Suppliers] ORDER BY [CompanyName]">
</asp:sqldatasource>
</div>
<div style="margin-top: 12px;">
Select Category:
<asp:dropdownlist id="ddlCategories" runat="server" appenddatabounditems="True" autopostback="True"
datasourceid="sdsCategories" datatextfield="CategoryName" datavaluefield="CategoryID">
<asp:listitem text="All Categories" value="-1">
</asp:listitem>
</asp:dropdownlist>
<asp:sqldatasource id="sdsCategories" runat="server" connectionstring="<%$ ConnectionStrings:NorthwindConnectionString %>"
selectcommand="SELECT [CategoryID], [CategoryName] FROM [Categories] ORDER By [CategoryName]">
</asp:sqldatasource>
</div>
<asp:gridview id="gvProducts" runat="server" autogeneratecolumns="False" datakeynames="ProductID"
datasourceid="sdsProducts" style="margin-top: 24px;">
<columns>
<asp:boundfield datafield="ProductID" headertext="ProductID" insertvisible="False"
readonly="True" sortexpression="ProductID" />
<asp:boundfield datafield="ProductName" headertext="ProductName" sortexpression="ProductName" />
<asp:boundfield datafield="CompanyName" headertext="Supplier" sortexpression="CompanyName" />
<asp:boundfield datafield="CategoryName" headertext="Category" sortexpression="CategoryName" />
</columns>
</asp:gridview>
<asp:sqldatasource id="sdsProducts" runat="server" connectionstring="<%$ ConnectionStrings:NorthwindConnectionString %>"
selectcommand="SELECT [P].[ProductID], [P].[ProductName], [P].[SupplierID], [P].[CategoryID], [S].[CompanyName], [C].[CategoryName] FROM [Products] AS [P] INNER JOIN [Suppliers] AS [S] ON [S].[SupplierID] = [P].[SupplierID] INNER JOIN [Categories] AS [C] ON [C].[CategoryID] = [P].[CategoryID] WHERE ([P].[SupplierID] = CASE WHEN @SupplierID = -1 THEN [P].[SupplierID] ELSE @SupplierID END AND [P].[CategoryID] = CASE WHEN @CategoryID = -1 THEN [P].[CategoryID] ELSE @CategoryID END) ORDER BY [P].[ProductName]">
<selectparameters>
<asp:controlparameter controlid="ddlSuppliers" name="SupplierID" propertyname="SelectedValue" type="Int32" />
<asp:controlparameter controlid="ddlCategories" name="CategoryID" propertyname="SelectedValue" type="Int32" />
</selectparameters>
</asp:sqldatasource>
</asp:content>
Я надеюсь, что это поможет вам ..