Haraka na Easy: Kupata SPFolder ya SPListItem katika kupokea Tukio

I hate kukubali hilo, 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:

binafsi utupu UpdateParentFolder(SPItemEventProperties mali)
{

SPFolder thisItemFolder = properties.ListItem.File.ParentFolder;
thisItemFolder.Item["ZZ Approval Status"] = "Good news, kila mtu!";
thisItemFolder.Item.Update();


} // UpdateParentFolder

Katika kesi hiyo, Mimi nina kazi na maktaba hati na mali ni kuja kutoka tukio ItemAdded.

hila ni kwamba huwezi kupata SPFolder ya bidhaa moja kwa moja kutoka bidhaa yenyewe (i.e. properties.ListItem.Folder ni null). Badala yake, kwenda Picha bidhaa orodha ya kuhusishwa na kupata folder faili ya.

</mwisho>

Kujiunga na blog yangu!

Tags technorati:

Wazo moja juu ya "Haraka na Easy: Kupata SPFolder ya SPListItem katika kupokea Tukio

Kuondoka Reply

Anwani yako si kuchapishwa. Mashamba required ni alama *