3

When defining sort criteria for a view, there is an option: Sort only by specified criteria (folders may not appear before items).

In my library, I have a view that is set to sort only by Name (for use in forms) in ascending order, and the Sort only by specified criteria option is not selected, but it is still sorting the folders along with everything else. I want the folders to be at the top of this view.

According to this TechNet post and this article, which were the top two results on my Google search for sharepoint Sort Only by Specified Criteria, when the box is unchecked, SharePoint should always display folders first.

And in case the issue was related to my choice of sort field, I also tried sorting by the other variations of Name fields, and also by Modified; in all cases, my folders are being sorted along with the other documents regardless of whether or not the Sort Only by Specified Criteria option is checked.

I have set no grouping, no filter, and Default style, and there are fewer than 5,000 items in the library.

Why won't my folders stay at the top of the library view?

3
  • I'm a newbie :-( Dan H has ended up with "Actually, I may have found an answer..." I'd be grateful to hear what is this. We have chosen not to let users make folders so I need a work-around to allow folders to be listed first.
    – cdfj
    Commented Jul 26, 2017 at 13:08
  • @cdfj if you have a new question please ask a new one at sharepoint.stackexchange.com/questions/ask Commented Jul 26, 2017 at 13:28
  • @cdfj I actually posted the answer. Maybe you were expecting the answer to be edited into the question? I posted the answer as an answer, an hour and a half after posting my comment about "I may have found an answer" - you just needed to scroll down a bit to find it. :) I didn't mark it as the accepted answer, though, in case anyone else had something better, but as it's now been over a year, I don't think anything else is coming. Commented Jul 26, 2017 at 16:27

3 Answers 3

2

I discovered that if the library setting Make "New Folder" command available? is set to Yes, folders sort as described/expected: at the top of any ascending sort, or the bottom of any descending sort, except when Sort only by specified criteria is selected. But if Make "New Folder" command available? is set to No, then folders are sorted inline with everything else, regardless of the Sort only by specified criteria setting.

I found this TechNet post (WayBack link) that describes the problem and establishes it as a known issue, but the only solution offered there is "use a custom sort on type or content type, or write some code". :(

So, the solution is to enable folder creation. If you need to retain normal sorting functionality while disallowing folder creation, the easiest approach would probably be to write code to disable the "New Folder" command, rather than trying to write code to reproduce the normal sorting functionality, a far more arduous task.

0

Dan, not sure if you already found a solution. I have library with the same behavior.

This is what I found so far:

If I copy the library with ShareGate to a test site then folders are still in the bottom.

If I manually create a new library in a test site and then copy my content types with ShareGate and then adds the content types to the library. Then folders are in the top.

Hope it helps

1
  • Actually, I may have found an answer, though not necessarily a satisfactory one. I'll post it when I'm not on mobile. Commented Jul 19, 2016 at 14:04
0

You could sort items by Item Child Count, so folders with child items are sent at the top (they are not sorted by name though, but at least they are grouped together)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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