Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Accessing list item properties via synchronous event handlers (WSS3)

  Asked By: Erik    Date: Mar 01    Category: Sharepoint    Views: 1612

I seem to have run into the problem described here...

spstips.blogspot.com/.../synchronous-add-list-event-itemaddin
g.html

...in which one is unable to access list item properties via synchronous
even handlers such as ItemAdding. Has anyone found a workaround?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Trinity Scott     Answered On: Mar 01

I have found  a workaround  for the problem  I mentioned below. Rather than
accessing list  item properties  directly using the syntax, e.g.,

string fieldValue =
Convert.ToString(properties.BeforeProperties[properties.ListItem.Fields[\
"Field Name"].InternalName]);

Iterate through the properties and pull out what you need, e.g.,
foreach (DictionaryEntry de in properties.BeforeProperties)
{
if de.Key.Equals("Field Name")
{
fieldValue = Convert.ToString(de.Value);
}
}

 




Tagged: