Click to See Complete Forum and Search --> : Create DropDownList with XML
_Leon_Gu
Nov 18th, 2004, 02:09 AM
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:
<?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.
nemaroller
Nov 19th, 2004, 07:54 AM
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.
nemaroller
Nov 19th, 2004, 07:57 AM
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
_Leon_Gu
Nov 22nd, 2004, 01:59 AM
Thank's a lot for the precise description!
I'm gonna try...
bye.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.