I have a problem with my eventreceiver. It is set to fire on updating item from a list, and works very good when I update that item from Sharepoint's web UI. However I have some code that goes through a list and updates it with new values, and this for some reason doesn't fire the event. Here's the updating code:
SPListItemCollection listItemCollection = list.GetItems(query);
foreach(SPListItem item in listItemCollection)
{
int itemID = matches.FindIndex(match => match.WebID == item["vG_ID"].ToString());
if (itemID != -1)
{
if (item["vG1"].ToString() != matches[itemID].TeamLeftScore.ToString() ||
item["vG2"].ToString() != matches[itemID].TeamRightScore.ToString())
{
item["vG1"] = matches[itemID].TeamLeftScore;
item["vG2"] = matches[itemID].TeamRightScore;
item.Update();
}
}
}
How do I fix that?