Thanks for the reply.
Unfortunately this is not exactly what I'm looking for.
I don't want to count the nodes in the treeview but records that are linked to a node.
For example: take a look at a windows explorer window. You can see the folder structure and on the right the files that are in a particular folder.
I have the same kind of view but then I store both my 'DocumentGroups' (the folders) and my 'Documents' (the files) into a SQL database.
So I want to see on each node how many items are "under" it.
I find it hard to explain, but maybe I can give a link to an example on the internet: http://communityserver.org/files/40/themes_and_skins/category1025.aspx
Maybe then you can understand what result I want...
The difference is that I have 2 tables.
They are related to eachother. So 1 documentgroup can have 1 one more documents.
Hope this explains my problem a bit more?