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 7596883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:01:42+00:00 2026-05-30T22:01:42+00:00

I have a DropDownList in GridView . During the edit action, DropDownList s in

  • 0

I have a DropDownList in GridView. During the edit action, DropDownLists in all the rows work properly on editing (and updating).

But in certain rows, when I click edit button, it displays the following error:

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

This is the code:

<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="AccessDataSource4"
    DataTextField="ProvinceName" DataValueField="ProvinceName" SelectedValue='<%# Bind("Province") %>'>
</asp:DropDownList>

Table “RateCenters” is displayed in the Gridview, which has “Province Column”. Province column gets the source from the “ProvinceName” of the Table ProvinceList.

Kindly let me know the solution.

  • 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-30T22:01:43+00:00Added an answer on May 30, 2026 at 10:01 pm

    Your markup says you are binding the SelectedValue of your DropdownList to the “Province” field in your parent datasource (the datasource for the Gridview)

    The values in your DropDownList are coming from the “ProvinceName” field in your AccessDataSource4 control.

    This error means that your code is selecting a value from the GridView datasource (“Province” field) that does not exists in the list of values returned in the “ProvinceName” field of your AccessDataSource4 control.


    A quick solution to this would be to modify the “SelectCommand” of AccessDatasource4 so that it runs the same query as your GridView control’s datasource, but with only the one column you need (“ProvinceName”) in the SELECT list. That way you are guaranteed to have the same values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried different examples to filter a gridview by dropdownlist, but is it
I have a gridview 'GridViewMcm with dropdownlists while editing in first and second columns
I have a dropdownlist inside a gridview, that is loaded from a datasource when
I have got 2 DropDownList s on my Form and 1 GridView . I
I have a Gridview in which i have two templatefields of dropdownlist. I bound
I have an ASP.NET GridView with a DropDownList (in an Item Template) and a
I have DropDownList inside GridView. Now I would like to add event handler for
I have a dropdownlist in gridview and bind grid view from a function in
I have a gridview with dropdownlist in it. When the user changes the item
I'm looking to have a click event for all columns but the last column

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.