根据单元格文本过滤Gridview

时间:2013-03-23 17:16:17

标签: asp.net gridview

如何通过Order_status编写过滤gridview的代码,其中text = Pending and Paid? 这是我的模板字段

<asp:TemplateField HeaderText="Order Status" SortExpression="Order_status">
    <EditItemTemplate>
    <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("Order_status") %>' > 
         <asp:ListItem>Pending</asp:ListItem>
         <asp:ListItem>Paid</asp:ListItem>
         <asp:ListItem>Shipped</asp:ListItem>
         <asp:ListItem>Cancelled</asp:ListItem>
     </asp:DropDownList>
    </EditItemTemplate>
    <ItemTemplate>
         <asp:Label ID="Label4" runat="server"Text='<%# Bind("Order_status") %>'></asp:Label>
    </ItemTemplate>
</asp:TemplateField>

这是我的实体数据源

<asp:EntityDataSource ID="EDS_Orders" runat="server" EnableUpdate="true" EnableFlattening="False"  OrderBy="it.Order_date DESC"
                      ConnectionString="name=Bohemian1Entities" DefaultContainerName="Bohemian1Entities" EntitySetName="t_customer_orders"
                      where="it.Order_status = Pending and paid">       

</asp:EntityDataSource>

0 个答案:

没有答案