5 Cascading Dropdowns (Parent to Child and Child to Parent)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marknut
    New Member
    • Apr 2010
    • 42

    5 Cascading Dropdowns (Parent to Child and Child to Parent)

    Simple and blunt: my cascading dropdownlists clear when a postback occurs. Does anyone know a quick way around that?

    For more information, read on...

    I have 5 dropdown lists that define a training class location and line of business: Site, Parent Client, Client, Program, Project.

    I'm trying to build cascading dropdownlists that can work from any direction (i.e. select a site and all other lists are filtered by site...select a project and all other dropdown lists are filtered by project). I've built the SQL Select statement behind the lists that filters (accurately).
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Are you calling the DropDownList's DataBind method (or otherwise re-populating the lists) in the Page Load method?

    Comment

    • Marknut
      New Member
      • Apr 2010
      • 42

      #3
      No, but all of the dropdowns have autopostback set to true so they will databind once another dropdown has changed.

      Comment

      • Marknut
        New Member
        • Apr 2010
        • 42

        #4
        Answer

        I just wanted to post an answer.
        1. I dimed public variables
        2. Set those variables as the dropdownlist.se lectedvalues on page_load (If ispostback then...)
        3. Set the dropdownlist.se lectedvalue as the variables on the ddl databound

        Comment

        Working...