469,904 Members | 2,143 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

Databound TreeView

Using ASP.NET 2005/C# flavor, I need to dynamically populate a TreeView
control from the results of a SQL Server 2005 query. Clicking on the
end leaf of the tree will need to yield some details about that leaf
(Assuming I need to hit the database again) in a data view.

In terms of populating the TreeView, will I need to query the database
as XML in order to simplify the generation of the hierarchical results
in the tree? Or will it do this automajically as part of "declaritive
binding model" employed by .NET 2.0? Or will I need to iterate thru
the query results and add nodes, leaves, etc. manually?

Any suggestions are greatly appreciated.
Does anyone know of a good sample I can check out?
I'm also open to any 3rd Party tools for this task if it will make my
life easier.

Thanks in advance.
Loopsludge

Apr 21 '06 #1
2 3749
Hello Loppsludge - check out the recent msdn article by Jeff Prosise:
http://msdn.microsoft.com/msdnmag/is...02/WickedCode/
--
brians
http://www.limbertech.com
"Loopsludge" wrote:
Using ASP.NET 2005/C# flavor, I need to dynamically populate a TreeView
control from the results of a SQL Server 2005 query. Clicking on the
end leaf of the tree will need to yield some details about that leaf
(Assuming I need to hit the database again) in a data view.

In terms of populating the TreeView, will I need to query the database
as XML in order to simplify the generation of the hierarchical results
in the tree? Or will it do this automajically as part of "declaritive
binding model" employed by .NET 2.0? Or will I need to iterate thru
the query results and add nodes, leaves, etc. manually?

Any suggestions are greatly appreciated.
Does anyone know of a good sample I can check out?
I'm also open to any 3rd Party tools for this task if it will make my
life easier.

Thanks in advance.
Loopsludge

Apr 21 '06 #2
Hi,

sample of manual way:

http://aspalliance.com/732

You can also do it declaratively if you develop a hierarchical data source
(control) for your data.
http://msdn2.microsoft.com/en-US/lib...ol(VS.80).aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Loopsludge" <rs********@bluemulesoftware.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Using ASP.NET 2005/C# flavor, I need to dynamically populate a TreeView
control from the results of a SQL Server 2005 query. Clicking on the
end leaf of the tree will need to yield some details about that leaf
(Assuming I need to hit the database again) in a data view.

In terms of populating the TreeView, will I need to query the database
as XML in order to simplify the generation of the hierarchical results
in the tree? Or will it do this automajically as part of "declaritive
binding model" employed by .NET 2.0? Or will I need to iterate thru
the query results and add nodes, leaves, etc. manually?

Any suggestions are greatly appreciated.
Does anyone know of a good sample I can check out?
I'm also open to any 3rd Party tools for this task if it will make my
life easier.

Thanks in advance.
Loopsludge

Apr 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

42 posts views Thread by lauren quantrell | last post: by
1 post views Thread by Patrick Demets | last post: by
5 posts views Thread by SoKool | last post: by
6 posts views Thread by L.M | last post: by
14 posts views Thread by Mr.D | last post: by
3 posts views Thread by Jeff | last post: by
8 posts views Thread by Matt MacDonald | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.