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. ObjectDataSource bounded DropDownList in GridView

ObjectDataSource bounded DropDownList in GridView

Scheduled Pinned Locked Moved ASP.NET
helpcssdatabasesql-serversysadmin
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.
  • B Offline
    B Offline
    b43r_3oo3
    wrote on last edited by
    #1

    Hi Guys, I've following problem: I have a grid view which gets data from a SQL server through a DataSet and an ObjectDataSource. The DataSet holds queries to many tables. Now I try to show all the data in the grid view. When I try to show the data through a DDL, I get following error: 'DDLStatusItem' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

    <asp:TemplateField HeaderText="Status" SortExpression="Status">
    <ItemTemplate>
    <asp:DropDownList ID="DDLStatusItem" runat="server" OnInit="DDLStatusItem_OnInit" DataSourceID="ODSFilterGridByStatus" DataTextField="Beschreibung" DataValueField="StatusId" SelectedIndex='<%# Eval("StatusId") %>' SelectedValue='<%# Bind("Status") %>'>
    </asp:DropDownList>

    The ODS of the ddl is different from the gridview one. When I try to access the GV DataItems "StatusId" and "Status", it dosen't break. Does somebody know, what's my problem is? Have a nice weekend!

    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