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

  • Home
  • SEARCH
  • 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 8961907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:00:03+00:00 2026-06-15T16:00:03+00:00

I need a way to bind multiple drop down lists that are populated based

  • 0

I need a way to bind multiple drop down lists that are populated based on their parent node.

RootDDL <- child <- grandchild[]

The code looks something similar to

<FormView DataSoureceID="rootDatasource">
    <DropDownList ID="RootDLL" AutoPostBack="true">
        <!--items-->
    </DropDownList>
    <DropDownList ID="child" AutoPostBack="true" DataSourceID="ChildDataSource" />
    <SqlDataSource ID="ChildDataSource" />

    <DropDownList ID="grandchild" DataSourceID="GrandChildDataSource" SelectedValue='<%# Bind('SomeFieldInRootDatasource') %>' />
    <SqlDataSource ID="GrandChildDataSource">
        <SelectParameters>
            <ControlParameter ControlID="child" PropertyName="SelectedValue" />
        </SelectParameters>
    </SqlDataSource>
    <Button Command="Update" />
</FormView>
<SqlDataSource ID="rootDatasource">
    <InsertParameters>
        <asp:Parameter Name="SomeFieldInRootDatasource" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="SomeFieldInRootDatasource" />
    </UpdateParamters>
</SqlDataSource>

Changing the rootDDL works, unfortunately when the Child selectedvalue changes the grand child <%# Bind %> tries to rebind but cannot as it the FormView is no longer acting as a container.

It fails with

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Is there any solution to this problem that will not require me to add event (multiple) handlers?

  • 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-06-15T16:00:05+00:00Added an answer on June 15, 2026 at 4:00 pm

    I ended up creating a hiddenfield for each child dropdownlist that I then bound with the value I needed. I created a generic indexchange handler to then update the hiddenfeild with the desired result. This results in the bound field not being updated by a datasource (avoiding the rebind system call that was causing the issue in the first place).

    Not sure if this is the best solution but it should work for most cases.

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

Sidebar

Related Questions

I need a way to bind POJO objects to an external entity, that could
I need a way to automatically format Date and Number objects based on locale
I need to bind the image source that defined in code behind into ControlTemplate.
I need a simple way to bind the checkboxlist in asp.net /C# . I
Let's say I want to show multiple Drop Down Boxes each with the same
Possible Duplicate: Bind function to multiple events of different elements at once I need
I need a way to change the specific value of a column of a
I need a way in my Chrome extension to know when the browser is
I need a way to take text from a EditText as soon as the
it need a way to call function whose name is stored in a string

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.