Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

ListItem Parent Folder?

  Asked By: Eddy    Date: Aug 23    Category: Sharepoint    Views: 3625

Anyone know to get a ListItems Parent folder name?



3 Answers Found

Answer #1    Answered By: Nagesh Maulik     Answered On: Aug 23

From the WSS SDK:

SPListItem.Folder Property

Property Value

An SPFolder object that represents the folder  if the item is a folder;
otherwise null.

Answer #2    Answered By: Jonathan Scott     Answered On: Aug 23

I think you misunderstood his question. He is starting with a
particular SPListItem and trying to find out what folder  it is in. In
that case the folder property of the item will be null. I don't think
there is a way to find the parent  folder for a specific SPListItem other
than walk the folder hierarchy in the list and check each folder's item
collection to see if its in that folder.

Or am I reading the SDK incorrectly? Is there a property of a
SPListItem that will tell you what folder it is in?

Answer #3    Answered By: Asia Meyers     Answered On: Aug 23

Yes, the SPListItem has a Folder property.

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