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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:16:16+00:00 2026-05-25T17:16:16+00:00

Error is ddlgvRooms’ has a SelectedValue which is invalid because it does not exist

  • 0

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

I read a lot of people having issues with this particular problem but non of the fixes have worked for my case.I have tried a few different things such as setting appenddatabounditems=”true” also tried to set in the itemcollection a default null value.
Most of the forums post on this that I read were from a couple years ago im hoping they fixed this bug already and I am just overlooking something.

I am trying to get my cascading dropdownlist to work in a gridview edittemplate fields. I created these in my detailsview on insert everything works great.

MySetup
Basically I have a webmethod that has 2 functions getRooms and getJacks that are supposed to grab the data from the 2 datasets that I have created.The Datasets get their data from a couple of SQLSTOREDPROCEDURES.

My aspx page dropdownlist and AjaxCDDL looks like this

  <EditItemTemplate>
                       <asp:DropDownList ID="ddlgvRooms" runat="server"
                            SelectedValue='<%# Bind("intRoom") %>'>  
                     </asp:DropDownList>                                               <asp:CascadingDropDownID="ddlgvRooms_CascadingDropDown"                 
                         runat="server"
                         Enabled="True" 
                         TargetControlID="ddlgvRooms" 
                         Category="Jack"
                         ServiceMethod = "GetRooms"
                         ServicePath = "CascadingDropDownRooms.asmx"
                         LoadingText = "[Loading Rooms...]"
                         PromptText="Please Select Room"> 
                        </asp:CascadingDropDown>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblgvRoom" runat="server"                      Text='<%#  Eval("intRoom") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="JackNumber" SortExpression="intJack">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlgvJacks" runat="server"
                        Height="20px" Width="125px">

                        </asp:DropDownList>
                       <asp:CascadingDropDown ID="ddlgvJack_CascadingDropDown" 
                                            runat="server" 
                                            Enabled="True" 
                                            Category="Jack" 
                                            ServiceMethod="GetJacks" 
                                            ServicePath="CascadingDropDownRooms.asmx" 
                                            TargetControlID="ddlgvJacks" 
                                            ParentControlID="ddlgvRooms" 
                                            LoadingText="[Loading Jacks...]" 
                                            PromptValue="Please Select A Jack">
                        </asp:CascadingDropDown>

                    </EditItemTemplate>

<WebMethod()> _
    Public Function GetRooms(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
            Dim roomAdapter As New dsRoomsTableAdapters.roomlistTableAdapter()

            Dim roomValues As New List(Of CascadingDropDownNameValue)()
            For Each row As DataRow In roomAdapter.GetAllRooms()
                roomValues.Add(New CascadingDropDownNameValue(row("RoomName").ToString(), row("intRoom").ToString()))
            Next
            Return roomValues.ToArray()
        End Function

        <WebMethod()> _
        Public Function GetJacks(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
            Dim kv As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)

            Dim jackid As Integer
            If ((Not kv.ContainsKey("Jack")) Or (Not Int32.TryParse(kv("Jack"), jackid))) Then
                Return Nothing
            End If

            Dim jackAdapter As New dsRoomJacksTableAdapters.jacklistTableAdapter()

            Dim jackValues As New List(Of CascadingDropDownNameValue)()
            For Each row As DataRow In jackAdapter.GetJacksByRoomId(jackid)
                jackValues.Add(New CascadingDropDownNameValue(row("JackNumber").ToString(), row("intJack").ToString()))
            Next
            Return jackValues.ToArray()
        End Function
  • 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-25T17:16:17+00:00Added an answer on May 25, 2026 at 5:16 pm

    DropDownList ddlgvRoom = (DropDownList)GridView1.Rows[e.RowIndex].FindControl(“ddlgvRoom”);
    string strgvRoom = ddlgvRoom.SelectedItem.Text.ToString();

        DropDownList ddlgvJack = (DropDownList)
        GridView1.Rows[e.RowIndex].FindControl("ddlgvJack");
        string strgvJack = ddlgvJack.SelectedItem.Text.ToString();
    
        DropDownList ddlgvVlan = (DropDownList)
        GridView1.Rows[e.RowIndex].FindControl("ddlgvVlan");
        string strgvVlan = ddlgvVlan.SelectedItem.Text.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error 7 The type or namespace name 'SampleMain' does not exist in the namespace
Error Message: The route default does not exist. Yes, it doesn't exist. But as
Error : Error 1 bin\Debug\Daemon.exe.manifest;bin\Release\Daemon.exe.manifest is an invalid value for the InputManifest parameter of
Error: End tag for 'optgroup' which is not finished. You have probably failed to
Error 3 Running transformation: System.ArgumentException: Format of the initialization string does not conform to
Error in NSLog: *** -[NSThread initWithTarget:selector:object:]: target does not implement selector (*** -[Document myTcpClient])
Error: Could not find control 'mytextfield' in ControlParameter 'mycontrolparam'. <asp:ControlParameter ControlID=mytextfield Name=mycontrolparam PropertyName=Text Type=Int32
Error % javac StringTest.java StringTest.java:4: variable errorSoon might not have been initialized errorSoon[0] =
error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : >could not deduce template argument
Error: The ObjectContext instance has been disposed and can no longer be used for

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.