Click here to Skip to main content
13,866,049 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


31 bookmarked
Posted 24 Feb 2002

Tree List View Built with XSLT and DHTML

, 24 Feb 2002
Rate this:
Please Sign up or sign in to vote.
A tree view and list view hybrid built with XSLT and DHTML

Sample Image


I am a Visual C++ guy. So why I am talking about XSLT and DHTML now? Sometimes, I am tired of writing C++ codes. Think about how much code you need to write when you want to sink events in ATL, how much code you need to write when you build or manipulate collections in ATL. It's too much and boring. But with DHTML, there are tons of building blocks you can use. I don't need to build a grid control, I don't need to call GDI functions. And it has flexible layout, various appearances.

This idea comes from two reasons: one is I always wanted to build a tree list view by myself, the other is I am an XSLT learner now. ADOData.xml is the XML file generated by ADO when you persist a recordset as XML. ADOData2Hier.xsl is the XSLT file for transforming XML file into HTML file and does the work of grouping data into hierarchies. You can find the grouping method in XSLT from different sources, there is an article about it in Code Project too. Source codes are short, so just see source code for details.

The platform I mentioned is the platform on which I built this. I think it should be OK if you have IE5+ and XSLT (not XSL). I never used netscape because our company and I only use IE.

The codes are just to show the idea. There are many possible improvements.

  • declare global parameters in XSLT file, in the script call addParameter to decide which fields you want to do the grouping and summation (or other aggregation).
  • any number of levels of grouping, also you can declare global parameters, but this may require more work to do.
  • there is an article "fun with tables" in MSDN, you can integrate code from that article to do some column reordering, column choosing, etc.
  • use HTML, CSS features to make the appearance more colorful.

If somebody makes improvements, don't forget to send me a copy.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Michael Tan
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionExpand Collapse dont work in Firefox/Netscape Pin
disci15-Feb-07 23:59
memberdisci15-Feb-07 23:59 
GeneralThanks for sharing! Pin
DBuckner16-Apr-03 4:57
memberDBuckner16-Apr-03 4:57 
Questionwhy use concat in a key? Pin
VirtualLife30-Mar-03 7:17
memberVirtualLife30-Mar-03 7:17 
Generalyour download has no content!! Pin
Anonymous6-Sep-02 14:40
memberAnonymous6-Sep-02 14:40 
GeneralCode Pin
AFShin Dehghani25-Mar-02 6:52
memberAFShin Dehghani25-Mar-02 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190214.1 | Last Updated 25 Feb 2002
Article Copyright 2002 by Michael Tan
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid