<asp:TemplateField HeaderText="资产类型">
DataTextField="GoodsFinaType" DataValueField="GFTID" DataSourceID="SqlDataSource1">
</ItemTemplate>
<ItemStyle Width="15%"></ItemStyle>
<ItemTemplate>
//定义DropDownList
<asp:DropDownList ID="ddl_type" runat="server" Width="95%" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "F_GFTID")%>'DataTextField="GoodsFinaType" DataValueField="GFTID" DataSourceID="SqlDataSource1">
</asp:DropDownList>
//绑定数据
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SCI_ERP %>"
SelectCommand="SELECT GFTID,GoodsFinaType FROM dbo.G_GoodsFinaType where IsUsing = 1"></asp:SqlDataSource></ItemTemplate>
<ItemStyle Width="15%"></ItemStyle>
</asp:TemplateField>
//循环取值
for (int i = 0; i < GV_ApplyDetail.Rows.Count; i++)
{
GridViewRow gRow = GV_ApplyDetail.Rows[i];
newRow["F_GFTID"] = ((DropDownList)gRow.FindControl("ddl_type")).SelectedItem.Value;
}