SPList.EnableFolderCreation Property
Gets or sets a Boolean value that specifies whether folders can be created for the list.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online