locked
Cascading drop-down lists - a sorry saga! RRS feed

  • Question

  • WSS 3.0

    My client has asked for some functionality that I think can only be achieved in a web part.

    I need to show a drop-down list of Products (this list comes from a database - and I can populate the drop-down fine).  When the user selects a Product, a second drop-down needs to show associated Sub Products.  I made the first drop-down AutoPostback=True, but I couldn't figure out how to store the value from the drop-down before it was recreated in the Createchild

    It doesn't seem possible in a normal web part, so I tried bundling the two drop-downs as a user control and sticking it in the Son Of SmartPart but although the control rendered, no code behind was firing so the drop-downs were empty.

    This seems like it ought to be easy, but I'm finding it difficult (but I'm not really a SharePoint developer).

    I've looked long and hard but most solutions seem to depend on SharePoint lists rather than data from databases.

    Any ideas gratefully received.

    Edward

    Friday, March 16, 2012 4:06 PM

Answers

  • I apologise for wasting everyone's time!  There should be a law against numpties like me posting on forums.

    Turns out that the problem was that I'd bound the dropdown list to a dataset instead of iterating through the rows and adding the items.  I now have a working cascading drop down web part built on database calls.  My client might even pay me.

    Anyway, thank you for your attention to my inattention.

    Edward

    • Marked as answer by Jack-Gao Friday, March 30, 2012 10:38 AM
    Monday, March 19, 2012 9:06 AM

All replies

  • you can work with BDC to achive the case cade drop down list while accessing the data from external database.

    MCTS,MCPD Sharepoint 2010. My Blog- http://sharepoint-journey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful


    Friday, March 16, 2012 6:16 PM
  • HI,

    IF you can use MOSS 2007 you can use BDC to achieve it. If SPS 2010 you can do this with external content type. However with WSS 3 these two functionalities are  not available.

    However if you have designed your logic through webpart code it should workout for you.

    Do share your code and we will check the issue it has


    Thanks, Rahul Rashu

    Friday, March 16, 2012 8:39 PM
  • I apologise for wasting everyone's time!  There should be a law against numpties like me posting on forums.

    Turns out that the problem was that I'd bound the dropdown list to a dataset instead of iterating through the rows and adding the items.  I now have a working cascading drop down web part built on database calls.  My client might even pay me.

    Anyway, thank you for your attention to my inattention.

    Edward

    • Marked as answer by Jack-Gao Friday, March 30, 2012 10:38 AM
    Monday, March 19, 2012 9:06 AM
  • Just a tip to let you know there actually is solutions available that can help you achieve this in lists: http://spservices.codeplex.com/wikipage?title=$().SPServices.SPCascadeDropdowns&referringTitle=Documentation
    Monday, March 19, 2012 7:49 PM