I have created a Gantt view for document library. Everything configured correctly. But when user add item using inline editing user gets error

"To add an item to a document library, use SPFileCollection.Add()"

. But same thing work perfectly for lists, but not working for document libraries. Is it a known issue in SP2013?


Yes, you cannot create an item in a document library without an associated file. Inline editing lets you fill in the column data, but does not have an interface for uploading a file, and thus cannot be used to create new documents in a library. This behavior is inherent to document libraries.

Every item in a document library needs to have an underlying file or folder before you can fill in the item's metadata.

  • How can I do it? Now I use lib.RootFolder.Files.Add() and then try to assotitate this file with item but get this error. – Alex Zhukovskiy Feb 20 '16 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.