locked
Custom Ordering in Document Library RRS feed

  • Question

  • Hi All,

    I would like to order the document library folders and files (in those folders) on a custom column. Is that possible? For example, I would like to create a "number" column and sort the items based on that column.

    Are there any other alternatives?

    Thanks

    Monday, October 11, 2010 9:17 PM

Answers

  • Yes, you can sort folders also.  In order to do this, though, you have to create a custom "folder" content type:

    1. Site Settings - site content types
    2. Click Create
    3. Call it "New folder" or whatever you want.  parent content type = "folder content type" and then "folder".
    4. Create a new site column to be associated with this new content type.  Call it "folder order" or something, and make it a number column.
    5. on your library, go to library settings and advanced settings.  Change "allow mgmt of content types" to YES
    6. In the library's settings "content types" section, click to add an existing content type, and pick that new one called "new folder" at step 3.
    7. In the library's advanced settings, change "Display "New Folder" command on the New menu" to NO.

    There ya go.  Now in the "new" drop-down box there's the ability to create a new folder, and that new folder has a "sort order" column.  Then you just have to sort your list by that column.


    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura
    • Marked as answer by diffident Tuesday, October 12, 2010 9:32 PM
    Tuesday, October 12, 2010 4:07 AM

All replies

  • Yes, you can create a custom column (data type: number) for the library and use that as the sort value for the document library view.  Create the column, enter the sort value you want, and then modify the view to change the sort order to base it on the custom column.

    I'm not sure what you mean by alternatives, you will have to supply the system will some value on which to sort, whether it's something like the document title, or a custom value that you select.

    Are you trying to prioritize the documents or just list them in the order they are added to the library (as opposed to the default which is probably the title)?  There is a default column of ID that is generated automatically that you can also use if you just want them sorted by the order they come in.

    Chanda

    Monday, October 11, 2010 9:28 PM
  • I need to be able to sort the folders too. When I created a custom column, I am not able to enter values for folders. Do you know how I can do that?

    For example, we are creating folders for each month - January 2010, Feb 2010, March 2010 etc.. so we need to sort them chronologically in ascending order which I am not able to achieve using the out-of-box columns.

    Monday, October 11, 2010 9:39 PM
  • Yes, you can sort folders also.  In order to do this, though, you have to create a custom "folder" content type:

    1. Site Settings - site content types
    2. Click Create
    3. Call it "New folder" or whatever you want.  parent content type = "folder content type" and then "folder".
    4. Create a new site column to be associated with this new content type.  Call it "folder order" or something, and make it a number column.
    5. on your library, go to library settings and advanced settings.  Change "allow mgmt of content types" to YES
    6. In the library's settings "content types" section, click to add an existing content type, and pick that new one called "new folder" at step 3.
    7. In the library's advanced settings, change "Display "New Folder" command on the New menu" to NO.

    There ya go.  Now in the "new" drop-down box there's the ability to create a new folder, and that new folder has a "sort order" column.  Then you just have to sort your list by that column.


    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura
    • Marked as answer by diffident Tuesday, October 12, 2010 9:32 PM
    Tuesday, October 12, 2010 4:07 AM
  • Hi,

     

    According to your description, I'll try to avoid creating folders. Instead I'd store the Meeting Date in a custom column as a meta-data. This will be really helpful in the long run. You can create a sortmeetingdoc docs by Meeting Date column. Make the Meeting Date mandatory so they are prompted to enter a date everytime a document is uploaded.

    For the sort order: Create a calculated field as follows (this is another advantage for not creating folders)

    Month=MONTH([Meeting Date]) and add a sort on this column.

    How to create a calculate field in SharePoint, hope to help you
    http://documentation.devexpress.com/#XtraReports/CustomDocument4801
    http://community.bamboosolutions.com/forums/t/4398.aspx

    I wish you every success in your important work.

    Best regards,

    David HM

    Wednesday, October 13, 2010 2:16 AM
  • using this instructions from LauraRogers MVP

    and using this article 

    will solve your problem.

    thanks.

    http://www.hamayda.com/

    Thursday, December 6, 2012 6:18 AM