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. Save unbound dropdownlist data

Save unbound dropdownlist data

Scheduled Pinned Locked Moved ASP.NET
questionhelpannouncement
4 Posts 2 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.
  • I Offline
    I Offline
    innocent73
    wrote on last edited by
    #1

    Hi folks, I have add a dropdownlist into my datagridview. This dropdown list consists two unbound value (item1= 'YES' and item2= 'NO') How can I update my datagridview data by using update button. Any idea? error message is: "DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items"

    C 1 Reply Last reply
    0
    • I innocent73

      Hi folks, I have add a dropdownlist into my datagridview. This dropdown list consists two unbound value (item1= 'YES' and item2= 'NO') How can I update my datagridview data by using update button. Any idea? error message is: "DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items"

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.

      Christian Graus Driven to the arms of OSX by Vista.

      I 2 Replies Last reply
      0
      • C Christian Graus

        Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.

        Christian Graus Driven to the arms of OSX by Vista.

        I Offline
        I Offline
        innocent73
        wrote on last edited by
        #3

        Thanks for your reply.. I have added the following code and no change occured: <asp:TemplateField HeaderText="EAN" SortExpression="EAN"> <EditItemTemplate>  <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="EAN" DataValueField="EAN" > <asp:ListItem Text="YES" Value="YES" /> <asp:ListItem Text="NO" Value="NO" /> </asp:DropDownList> </EditItemTemplate>

        1 Reply Last reply
        0
        • C Christian Graus

          Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.

          Christian Graus Driven to the arms of OSX by Vista.

          I Offline
          I Offline
          innocent73
          wrote on last edited by
          #4

          Hello, Thank you for your reply. I have added the following code but nothing changed: <asp:TemplateField HeaderText="EAN" SortExpression="EAN"> <EditItemTemplate>  <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="EAN" DataValueField="EAN" > <asp:ListItem Text="YES" Value="YES" /> <asp:ListItem Text="NO" Value="NO" /> </asp:DropDownList> </EditItemTemplate>

          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