Unë e urrej të pranoj atë, but I struggled with this one all day. My event receiver needs to update a field of its parent folder. This little bit shows how to do it:
privat pavlefshme UpdateParentFolder(SPItemEventProperties Prona të paluajtshme)
{
SPFolder thisItemFolder = properties.ListItem.File.ParentFolder;
thisItemFolder.Item["ZZ Approval Status"] = "Good news, gjithkush!";
thisItemFolder.Item.Update();
} // UpdateParentFolder
Në këtë rast, I’m working with a document library and the properties are coming from an ItemAdded event.
The trick is that you can’t get the SPFolder of the item directly from the item itself (i.e. properties.ListItem.Folder is null). Në vend të kësaj, go to the list item’s associated File and get the File’s folder.
</fund>