我有一个 asp.net 网格视图。下拉列表类型的模板字段包含在列中:
<asp:TemplateField HeaderTextLabel="strManagedOETeamart">
<ItemTemplate>
<asp:DropDownList runat="server" AutoPostBack="True" OnSelectedIndexChanged="SelectedTeamartChanged">
<asp:ListItem Selected="True" Value="White"> White </asp:ListItem>
<asp:ListItem Value="Silver"> Silver </asp:ListItem>
<asp:ListItem Value="DarkGray"> Dark Gray </asp:ListItem>
<asp:ListItem Value="Khaki"> Khaki </asp:ListItem>
<asp:ListItem Value="DarkKhaki"> Dark Khaki </asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
当用户选择另一个项目时,如何获取 GridViewRow?
protected void SelectedTeamartChanged(object sender, EventArgs e)
{
DropDownList dropDown = (DropDownList) sender;
//I would like to know the GridViewRow this DropDownList is in
}