日期:2014-05-17  浏览次数:20446 次

哭求:关于在GridView增加一行,然后在GridView模板列动态绑定下拉框的值问题
ASPX页面的代码:
 <asp:GridView ID="gv_Order" runat="server" AutoGenerateColumns="False" Width="921px" DataKeyNames="OrderCode" OnRowCreated="gv_Order_RowCreated">
  <Columns>
  <asp:TemplateField HeaderText="订单编号">
  <ItemTemplate>
  <asp:TextBox ID="txtOrderCode" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "OrderCode")%>' Width="131px"></asp:TextBox>
  </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="产品名称">
  <ItemTemplate>
  <asp:DropDownList ID="ddlP" runat="server" AutoPostBack=true SelectedValue='<%# DataBinder.Eval(Container.DataItem, "PCode")%>'>  
   
  </asp:DropDownList> 
   
  </ItemTemplate>
   
   
  </asp:TemplateField>
  <asp:TemplateField HeaderText="订购数量">
  <ItemTemplate>
  <asp:TextBox ID="txtNumber" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Number")%>' Width="69px"></asp:TextBox>
  </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="优惠率">
  <ItemTemplate>
  <asp:TextBox ID="txtDiscount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Discount")%>' Width="61px"></asp:TextBox>
  </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="订货日期">
  <ItemTemplate>
  <asp:TextBox ID="txtDate" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Date")%>' Width="131px"></asp:TextBox>
  </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="送货日期">
  <ItemTemplate>
  <input id="txtTime" runat="server" name="Text1" onfocus="calendar()" onkeypress="return false"
  onselectstart="return false;" readonly="readonly" style="width: 131px" type="text" value='<%# DataBinder.Eval(Container.DataItem, "DeliveGoodsDate")%>'/>
  </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="出库状态">
   
  <ItemTemplate>  
  <asp:DropDownList ID="ddlS" runat="server" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "M_IsStock")%&g