Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

ASP .NET TreeView component?

Is there any good TreeView component for ASP .NET?

Here is what I have in mind:

- the client should be able to expand/collapse branches

- there should be a setable image for every node

- (only if possible / available) it should be able to show a folder (+files and subfolders) on a server, in an Explorer-like way

Thank you!

Jack Thybolt
Thursday, September 11, 2003

I just did this exact thing in VB.NET using the MS IE Treeview control. Check it out, it's quite nice, downgrades for older browsers well, etc.

Doing it through a code-behind it's then straightforward to build a tree out of the system.io functions to show directories, files, etc. And you can set node images separately.

The IE controls library also included other things such as tab bars, etc., but I haven't worked with them.

  --Josh

P.S. You can check out the finished example here:

http://www.ip-us.com/blp-e/lockoutpro

JWA
Thursday, September 11, 2003

Microsoft IE TreeView:
http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=75&tabindex=2
Source code now available also.

Duncan Smart
Friday, September 12, 2003

We rolled out own because we couldn't limit ourselves to IE. Part of the problem is the trade-off of whether you want to remember how "open" the tree is on round-trips, vs. how quickly they can open the tree.

If you use client-side opening, then you end up having to add a lot of client-side logic to keep track between round-trips about open nodes (and, of course, count on the presence and enablement of JavaScript). You also end up sending the whole tree, always, which could be quite large.

If you use server-side opening, tracking is much easier, but every open causes a round-trip, which can feel sluggish if the connection is slow.

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, September 12, 2003

The IE controls work fine on non-IE (tested personally on NS7 and Firebird) and older browsers. You just don't get the pretty DHTML effects.

  --Josh

JWA
Friday, September 12, 2003

This is very interesting!

Exactly how does one use this TreeView control?

Is it a normal ASP .NET control?

Bad Blood
Friday, September 12, 2003

>>Exactly how does one use this TreeView control?
Download it and read the instructions.

>>Is it a normal ASP .NET control?
Yes

Duncan Smart
Saturday, September 13, 2003

"The IE controls work fine on non-IE (tested personally on NS7 and Firebird) and older browsers. You just don't get the pretty DHTML effects."

Which was sort of my point. Given that the DHTML functionality in Netscape 7 (Mozilla) is actually better and more standards compliant than IE, it stands to reason that the "IE TreeView Control" is only fully functional on IE because it's in Microsoft's best interest to dupe people into believing that Mozilla is a bad web platform (by making their controls "downlevel" on what is clearly a fuller featured browser).

Brad Wilson (dotnetguy.techieswithcats.com)
Saturday, September 13, 2003

Oh, that is a good point BRad, I didn't think about it that way.

  --Josh

JWA
Saturday, September 13, 2003

*  Recent Topics

*  Fog Creek Home