Hello
I have a Task List, and I want to add items to it programaticaly in C#. I have a problem with adding a summary task. Now I figured out how to add such item:
var myList = SPContext.Current.Web.Lists["MyList"];
SPContentType type = myList.ContentTypes["Summary Task"];
SPListItem newItem= myList.Folders.Add();
newItem["ContentTypeId"] = type.Id;
newItem.Update();
newItem["Title"] = "MyTitle";
newItem.Update();
myList.Update();
The problem is, Title column contains something like "79_.000" (the number increments for newly added element, guess its the id) instead of "MyTitle". When I skip the newItem["ContentTypeId"] = type.Id; line (and update) tthe name is ok, but the item is not recognized as a summary task. I see that the DisplayName property is the wrong one, but Name is ok. Unfortunately DisplayName is read only, so I can't modify it (but maybe this would not be the best approach)
I'm using SP 2010 foundation. Any help would be apprectated