NET 2.0 is about to be released to manufacturing, we ASP.
NET developers have very interesting times ahead of us.
I'm using VS2012-C# and had to make one adjustment to your code to avoid the error [The name ' Tree View1' does not exist in the current context.] I see others have gotten this at times too, and it is difficult for new users to troublehsoot.
I had to enclose the content[not the using statments] of the code behind page in a namespace where the namespace was the project name. Have been looking for a way to do 3 level menus for a while, as I had found some code that could do 2 levels, but wasn't easily adaptable for 3 levels.
Was able to adapt this to suit a horizontal menu as well as horizontally arranged treeviews. I had to convert your code to C#, but that was easy except for two problems I had. I spent a good hour searching MSDN for CInt in C# but all the articles were in VB so I guess C# doesn't have one.
With this code and data, I can see that I can do as many levels in my menus/treeviews as I like, based around the parent id settings for each option. Once I concluded that, I just type casted it to an Int32.
With this setup, trying our sample page and expanding the nodes, we should get a view like this. I am looking for a hierarchical control where each row can be expanded to show a table of values(nesting levels can be 6 or more).
Sample I’m going to provide a simple example how to display hierarchical data from SQL Server database in the Tree View. Next, we want to create the routine to populate the child nodes of a given node. Listing #4 Here, the idea is the same as with the root level, but with the distinction that only child nodes of the given node are queried and populated with the Populate Nodes method (described earlier). I try Fly Fly Tree View but its not free does any budy have the solution???????????? Thank you very here is code for add Treeview to Database Private Sub Get All Children(By Val parent Node As Tree Node, By Val str Parent ID As Integer) For Each child Node As Tree Node In parent Node. The trick to triggering the populating of the child nodes is as follows. Configuration;public partial class _Default : System. Child Nodes Dim parent ID As Integer parent ID = Insert Node(child Node. In another one, I had to use the C# funcion Convert. The functions work to populate a Tree View with the table you layed out. The only thing I need to do is add a column to mine with the navigate URL string since I'm using the Tree View as my menu for my website. Paul Sql Command obj Command = new Sql Command( "SELECT id, description, (SELECT COUNT(*) AS Expr1 " "FROM navigation_list " "WHERE (parent_id = sc.id)) AS childnodecount " "FROM navigation_list AS sc " "WHERE (parent_id = @parent ID)", obj Conn);and you should close your connection on each request..Conn.