Edit Item Template, Dropdown list
-
Hello, I currently have two dropdown lists in an edit item template and I have hard coded the values for the lists. The Item Template is a label that would read the value that was selected. That value would when be sent to a database. When I hit edit, the dropdown lists appear, and I change the value. When I hit update, the Item Templates do not update with the selected values, and when I hit edit again, the values are back to the default, not what I selected. Can someone help me figure out how to fix this? The code is below, thanks for your time.
<asp:GridView ID="GridView_Service_Tower_Configuration_Options"
runat="server" AutoGenerateColumns="False"
DataSourceID="DS_Configuration_Options" CellPadding="4"
GridLines="None" Width="600px"
DataKeyNames = "category" ForeColor="#333333">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:CommandField ShowEditButton="true" />
<asp:BoundField DataField="category" HeaderText="Service Tower"
SortExpression="Category" ReadOnly="True"/>
<asp:CheckBoxField DataField="include" HeaderText="New Service Provider"
SortExpression="include" >
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:CheckBoxField>
<asp:TemplateField HeaderText="Transition Year"
SortExpression="Transition Year">
<EditItemTemplate><asp:DropDownList ID="drpTransitionYear" runat="server" Width="70px"> <asp:ListItem>2010</asp:ListItem> <asp:ListItem>2011</asp:ListItem> <asp:ListItem>2012</asp:ListItem> <asp:ListItem>2013</asp:ListItem> <asp:ListItem>2014</asp:ListItem> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("purchase\_year") %>'></asp:Label>