I have a gridview in .net 2.0 with a dropdownlist of two items - that being "active" and "inactive".
<EditItemTemplate> <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="true">
<asp:ListItem Text="active" Value="active"></asp:ListItem>
<asp:ListItem Text="inactive" Value="inactive"></asp:ListItem
</asp:DropDownList>
</EditItemTemplate>
I also have AutoGenerateEditButton="true" AutoGenerateDeleteButton="true".
So when I run the application and click the edit button on a row I get the values for the other fields in textboxes as I expect, but for the dropdownlist, I get the two values in a dropdown, but the one that was chosen for that row already is NOT showing as the first one (selected).
With asp.net 1.1 I used the ItemDataBound event to handle getting the selected value for each dropdownlist when being displayed in edit. The ItemDataBound event is no longer available for this "new" datagrid know as the gridview.
How can I capture the current value of a row's dropdownlist as the selected one in that list and in what event can this be done?