I created a deatailsview and in edit mode I want to replace the edit mode textbox with a dropdownlist.
I did the following so far:
- I converted the field into a TemplateField and deleted the textbox
- I addedd a dropdownlist with two static values y and n
What do I need to do to get the dropdownlist select value to edit the field like the texbox does?
1 <EditItemTemplate>
2
3
4
5 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" Style="position: relative; left: 0px;">
6
7 <asp:ListItem Value="Y">Yes</asp:ListItem>
8
9 <asp:ListItem Value="N">No</asp:ListItem>
10
11 </asp:DropDownList>
12
13 </EditItemTemplate>
14
15 <InsertItemTemplate>
16
17 <asp:DropDownList ID="DropDownList2" runat="server" Style="position: relative" AutoPostBack="True">
18
19 <asp:ListItem Selected="True">Yes</asp:ListItem>
20
21 <asp:ListItem>No</asp:ListItem>
22
23 </asp:DropDownList>
24
25 </InsertItemTemplate>
26
27 <ItemTemplate>
28
29 <asp:Label ID="Label1" runat="server" Text='