I have a sharepoint list (Not Library), where I am programatically adding in a folder:
SPList list = web.Lists[ListID]; SPFolder parent = list.RootFolder; SPFolder child = parent.SubFolders.Add(FolderName); parent.Update(); child.Update();
This adds in a folder to the library, to which I then add in a listitem:
SPListItem item = list.AddItem(child.Url, SPFileSystemObjectType.File); item[DefaultSettings.S_COL_Title] = "New title"; item.Update();
The net result of this is that the item is added with no errors. But when I go to my library I do not see the item.
If I go into the view and change the option under Foldering from "Show items inside folders" to "Show all items without folders", my newly added item is then visible. Also if I manually type in the url to the folder, I can see the item.
So I know the item is there, and that it is in its folder.
I want the folder to display in the view, and if I click on the folder to then see the item.
How can I achieve this?