【发布时间】:2013-04-15 10:25:07
【问题描述】:
我在 DataGrid EditItemTemplate 中创建了一个 DropDownList。 (手动)
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="nazwa" DataValueField="nazwa"
SelectedValue='<%# Bind("nazwa") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:baza_pismConnectionString1 %>"
SelectCommand="SELECT [nazwa] FROM [podmioty]"></asp:SqlDataSource>
</EditItemTemplate>
如何从后面代码中的下拉列表中获取选定的值?
【问题讨论】:
-
当你想要下拉选择的值时,我的意思是在哪个事件
-
尝试查看 DropDownList 的 CommandName 和 CommandArgument 属性,以及 GridView 的 OnRowCommand 属性/事件。
标签: c# asp.net gridview drop-down-menu