Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7548571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:43:56+00:00 2026-05-30T09:43:56+00:00

Im trying to do bind a dropdown list to a details view but keep

  • 0

Im trying to do bind a dropdown list to a details view but keep getting an error about the dropdown list ID field:

<asp:TemplateField HeaderText="Approval">
                <ItemTemplate>
                    <asp:DropDownList ID="Approved" runat="server" DataValueField="Approved" SelectedValue='<%#Bind("Approved") %>'>
                        <asp:ListItem Text="Approved" Value="Approved" />
                        <asp:ListItem Text="Denied" Value="Denied"/>

                    </asp:DropDownList>
                </ItemTemplate>                   
 </asp:TemplateField>

The error message as follows:

‘Approved’ has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

What is the proper way to attach the value of the dropdownlist to my object so that it can be properly created in the database? Most of my searches keep telling me how to bind a dropdownlist to an object data source, but that is not what I need to do. This is a basic drop down list of 2 items that will never change.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:43:57+00:00Added an answer on May 30, 2026 at 9:43 am

    This error happens because you are binding the SelectedValue of the DropDownList to the “Approved” field of your DetailsView‘s datasource, but the value it’s trying to assign isn’t one of the two you have listed (“Approved” and “Denied”).

    I see you have set DataValueField="Approved". Are you setting the Dropdown’s Datasource in code-behind? Because that is not going to set your ListItems to the values from the “Approved” column in the DetailsView‘s datasource, it’s setting them to whatever the datasource for the Dropdown is.

    Depending on your logic, here are some possibilites:

    • Make sure your static items match the possible items returned in the “Approved” field of the DetailsView. Or,
    • Bind the DropDownList to a dataset that includes all the possible values from “Approved”, and completely removed your static items. Or,
    • Set AppendDataBoundItems="True" in your DropDown and have both static and databound items
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to bind a selected user's role to a dropdown-list. The purpose of
I am using a dropdown list in ASP.NET with C#. I am trying to
I am trying set up a simple dropdown list but I dont seem to
Ok guys, so I am trying to bind data into a dropdown list from
I'm trying to bind an ASP.net DropDownList to the results of an entity framework
I'm trying to get a list of usernames and bind them to a DropDownList
Im trying to bind a list with datetime objects to my repeater. if (e.Item.ItemType
I'm trying to bind a list of custom objects to a WPF Image like
I'm trying to bind a list of integers into an SQLTemplate IN clause like
I'm trying to bind my view to my view model without DataObjectProvider. The following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.