Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Folder content type

  Asked By: Karissa    Date: Dec 25    Category: Sharepoint    Views: 1852

In a list that has folders and items within folders, what is the best
way to get a handle to a folder from the item that was created within
the folder.

The best that I can come up is to use SPListItem url property of and
then parse the url to figure out which folder I need. In my case each
folder has a unique title.



3 Answers Found

Answer #1    Answered By: Donte Jefferson     Answered On: Dec 25


Answer #2    Answered By: Beau Pena     Answered On: Dec 25

Unfortunately, this does not work for me. I am working with a custom
list that has list folder  and list  item content  types. I am writing
this code in ItemAdded list event. When a user creates a new list item
for a particular folder, I need to get a handle  to the folder and
populate some fields on the item  based on folder's data. I get an
exception when I try your code b/c SPListItem.Folder is null. Does is
only work on document library lists?

Answer #3    Answered By: Isaiah Santiago     Answered On: Dec 25

Interesting. I've never tried using folders  in a list  (as opposed to doc lib)
so I guess I can't help ya there.

Didn't find what you were looking for? Find more on Folder content type Or get search suggestion and latest updates.