Why is this filter not being applied?

Why are documents inside a folder not showing when a filter is applied?

  • I added a custom column called Project (string) to a Document List. I then set different views in different pages to filter on that column. The problem is that, when applying the filter, documents stored inside folders are not shown even if the value of the Project column corresponds to the one set in the filter. Do you know how to solve this problem?

  • Answer:

    Based on your last comment I create a webpart to show the Document List on a certain page, and then I applied a filter on a column content to show only certain documents. But in that way the folder structure is lost and all documents are shown flat. I think I can answer your your question now. If you create a new view and select in the filter section Content Type Equals Folder OR And then add the additional condition you wish to apply to the documents. In this way folders will always be displayed but their contents will be filtered based on the additional constraint. This will cause folders to be displayed whether or not they contain any children matching the additional constraint but you will be able to navigate the hierarchy.

Drake at SharePoint Visit the source

Was this solution helpful to you?

Other answers

If you created the view in code you will need to specify the Scope="Recursive" ViewAttribute Some examples are given here http://sharepointmagazine.net/technical/development/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list If you created the views with the SharePoint UI you will need to Modify the view. Expand the "Folders" section in the Edit View page Select "Show all items without folders" This will perform a recursive query.

Steve P

Specifying ViewAttributes Scope='Recursive' does not seem to work, Rather the Scope property of SPView needs to be set to Recursive: SPView view = list.Views.Add(“TestView”, fields, string.Empty, 100, true, false); view.Scope = SPViewScope.Recursive; Here is a complete example: http://sharepointnadeem.blogspot.in/2012/02/create-view-to-show-all-items-without.html

Nadeem Yousuf

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.