Results 1 to 4 of 4

Thread: Create DropDownList with XML

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    2

    Create DropDownList with XML

    Hi all!

    I'm looking for a solution for how to create a DropDownList in an aspx page with VB. The values of this list are stored in an XML file which looks like this one:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <list>
        <prof name="bill">
            <nomClasse>1</nomClasse>
            <nomClasse>2</nomClasse>
            <nomClasse>3</nomClasse>
        </prof>
        <prof name="gates">
             <nomClasse>4</nomClasse>
             <nomClasse>5</nomClasse>
        </prof>
    </list>
    I want to create the droplist by checking which professor is logged in.

    Can someone help me.......

    Thank's a lot!

    Bye.

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    What you are looking to create is called a Hierarchical TreeView control for ASP.Net

    Having implemented one myself - the building of the treeview is rather complex.

    You need to be able to:

    1) develop Custom controls (inheriting from WebControl)
    2) do XML transforms (specifically sort)
    3) know Javascript - for client-side keypress or mouse events
    4) DHTML - to show or hide divs and table
    5) Dynamically creating html tables from the server side

    So be sure you are competent in doing these things.

    Basically you create a new server control by inheriting webcontrol, and in the createchildcontrols - use load in your xml, do a transform and then proceed to build the child controls.

    For my treeview, I use a hidden input field to store the selected value, a visible textbox to display the selected value (and type in a value using a complex type-ahead javascript algorithm).

    You then need to create a div that contains the actual treeview that appears under the textbox when the focus is obtained by the textbox.

    The div contains nested html tables that show or hide depending if the user clicked a + to expand the node or not.

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    For all the trouble its worth - you might ponder the possibility of buying a control someone has already developed and sells commercially...

    here's a listing..

    http://www.411asp.net/home/assembly/navigator/treeview

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    2
    Thank's a lot for the precise description!

    I'm gonna try...

    bye.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width