1

我应该如何编写代码来按 Order_status 过滤 gridview,其中 text= Pending 和 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>
4

0 回答 0