Recursive population of a TreeView? 
Author Message
 Recursive population of a TreeView?

Hi. Can somebody post a link or code snippet telling how to
recursively populate a TreeView from a SQL Server in C#? The database
contains a table with the parent and child node ID's.


Thu, 30 Dec 2004 23:32:48 GMT  
 Recursive population of a TreeView?
Someone? Please..
Quote:

> Hi. Can somebody post a link or code snippet telling how to
> recursively populate a TreeView from a SQL Server in c#? The database
> contains a table with the parent and child node ID's.



Fri, 31 Dec 2004 16:02:09 GMT  
 Recursive population of a TreeView?
How is the parent-child relationship represented in the
database?

-c


Quote:
> Someone? Please..




Quote:
> > Hi. Can somebody post a link or code snippet telling how to
> > recursively populate a TreeView from a SQL Server in c#? The database
> > contains a table with the parent and child node ID's.



Sat, 01 Jan 2005 02:16:01 GMT  
 Recursive population of a TreeView?
With a menuID which is the primary key and a parentID which is the column
that is used to create the depth in the tree. This is what I have done:

I want to use XML and XSL to populate a TreeView. This is the markup for the
TreeView element:

<iewc:treeview id="tree1" runat="server"
TreeNodeSrc="http://localhost/myxml/xmltest/menus2.xml"
TreeNodeXsltSrc="http://localhost/myxml/xmltest/menus2.xsl"></iewc:treeview>

The menus2.xml file contains the following:

<?xml version="1.0" ?>
<root xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl="menus2.xsl">
<sql:query>
select * from menus for xml auto
</sql:query>
</root>

The menus2.xsl file contains the following:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="/">
<TREENODES>

</TREENODES>
</xsl:template>

<xsl:template match="menus">

<treenode>

<xsl:attribute name="NavigateURL"><xsl:value-of

<xsl:attribute name="Target" >main</xsl:attribute>

</treenode>
</xsl:template>

</xsl:stylesheet>

I have created a virtual directory with IIS Virtual Directory Managment for
SQL Server with the local path to the directory that contains menus2.xml and
menus2.xsl. Furthermore I have defined a virtual name under the Virtual
Names tab with the type template and the same path as above. When I go to
http://localhost/myxml/xmltest/menus2.xml in IE I get the correct XML. But
when I try to Build and Browse my .aspx-file the TreeView is empty!

Why is it empty?



Sat, 01 Jan 2005 04:29:37 GMT  
 Recursive population of a TreeView?
Sorry Krsitoffer, I don't know much about XSLT as it relates
to TreeViews. Perhaps someone else here knows how.

-c


Quote:
> With a menuID which is the primary key and a parentID which is the column
> that is used to create the depth in the tree. This is what I have done:

> I want to use XML and XSL to populate a TreeView. This is the markup for
the
> TreeView element:

> <iewc:treeview id="tree1" runat="server"
> TreeNodeSrc="http://localhost/myxml/xmltest/menus2.xml"

TreeNodeXsltSrc="http://localhost/myxml/xmltest/menus2.xsl"></iewc:treeview>
Quote:

> The menus2.xml file contains the following:

> <?xml version="1.0" ?>
> <root xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl="menus2.xsl">
> <sql:query>
> select * from menus for xml auto
> </sql:query>
> </root>

> The menus2.xsl file contains the following:

> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">

> <xsl:template match="/">
> <TREENODES>

> </TREENODES>
> </xsl:template>

> <xsl:template match="menus">

> <treenode>

> <xsl:attribute name="NavigateURL"><xsl:value-of

> <xsl:attribute name="Target" >main</xsl:attribute>

> </treenode>
> </xsl:template>

> </xsl:stylesheet>

> I have created a virtual directory with IIS Virtual Directory Managment
for
> SQL Server with the local path to the directory that contains menus2.xml
and
> menus2.xsl. Furthermore I have defined a virtual name under the Virtual
> Names tab with the type template and the same path as above. When I go to
> http://localhost/myxml/xmltest/menus2.xml in IE I get the correct XML. But
> when I try to Build and Browse my .aspx-file the TreeView is empty!

> Why is it empty?



Sat, 01 Jan 2005 05:19:27 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Recursive to non-recursive

2. File Population

3. Population program

4. Population count.

5. column population in ClistCrtl

6. Dynamic population of menus

7. Tree Population

8. Help: Fast/Efficient population of ListView

9. Change events AFTER population on any standard winform control

10. Asynchronous socket & recursive receiving

11. how get rid of recursive checkout?

12. Recursive program that evaluate a postfix expression

 

 
Powered by phpBB® Forum Software