Geeks With Blogs

Tangible Thoughts SharePoint, MOSS? and all the other questions

In WSS v3, the concept of folders has been introduced into lists, and a folder is also a Content Type, which basically means that you could define your your custom columns/fields against a folder as a content type to track metadata of interest. For example within a Book list, you could have Genre as a Content Type derived from Folders, which could contain a series of book items.

I am not going to argue that  genre is more appropriate to be a field against the book item rather than a folder, but bare with me for the moment.

Now using the API per given book item, there is no direct means of finding the containing folder.

It would be ideal if the SPListItem object had the method

SPListItem.GetContainingFolder() : SPListItem

but it hasnt.

So my only guess right now is to CAML query the list based on Content Type where the Title of the folder should contain the folder part of the book item's url path field which suspect wont give accurate results.

Or query the WSS DB directly

Do you guys have any other ideas?

Cross-posted from

Posted on Tuesday, August 29, 2006 8:42 PM Programming , SharePoint | Back to top

Comments on this post: SPListItem Hierarchy not Navigable through API

# re: SPListItem Hierarchy not Navigable through API
Requesting Gravatar...
Even though this is pretty old, I haven't found a really good workaround. Any news on this?
Left by Martin on Apr 06, 2009 10:02 PM

Your comment:
 (will show your gravatar)

Copyright © Tariq | Powered by: