Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Edit Item Template, Dropdown list

Edit Item Template, Dropdown list

Scheduled Pinned Locked Moved ASP.NET
helpdatabasewpfsysadmintutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JohnQuar1
    wrote on last edited by
    #1

    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>
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups