locked
Adding asp.net tree view in master page RRS feed

  • Question

  • I want to asp tree view instead of quick launch to the master page of my sp site.
    Can asp tree view can show all child folders in document library automatically like tree view in windows explorer?

    Thanks
             ^.^ axiomkid
    Tuesday, July 28, 2009 9:55 AM

Answers

  • You can enable the Tree View in Site Settings (Site Actions / Site Settings / Look and Feel / Tree View [/_layouts/navoptions.aspx]-- This navigation will vary slightly depending on your version of SharePoint [WSS or MOSS] and the Site Template you'vce used).

    The Tree View will only display the lists and libraries in the site. If you want a true Windows Explorer-like view, you can use the Explorer View for the Document Library itself.

    M.
    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    • Marked as answer by Chengyi Wu Wednesday, July 29, 2009 9:51 AM
    Tuesday, July 28, 2009 1:38 PM

  • As Marc has said, just turn on the Tree View, and optionally turn off the Quick Launch by using the Site Settings options. You can also hide/show these in the master page.

    The Tree View is customizable, but not from Site Settings in the browser. Here are some of the things you can change by modifing the master page:

    Options to show or hide:

    <SharePoint:SPHierarchyDataSourceControl
      runat="server" id="TreeViewDataSource2" RootContextObject="Web"
      IncludeDiscussionFolders="true"
      ShowDocLibChildren="true"
      ShowFolderChildren="true"
      ShowListChildren="true"
      ShowWebChildren="true"
    />

    ShowFolderChildren – set to false to hide all folders within all lists and libraries
    IncludeDiscussionFolders – set to true to show individual discussions as folders in the tree view (ShowFolderChildren="false" overrides this option)
    ShowListChildren – set to false to hide all lists, including calendars, tasks and discussions
    ShowWebChildren – set to false to hide sub sites
    ShowDocLibChildren – set to false to hide document libraries 


    To control the depth (levels opened by default)

    <SharePoint:SPRememberScroll …… >
      <SharePoint:SPTreeView id="WebTreeView2" runat="server"
        ShowLines="true" ExpandDepth="10"
             …
      </SharePoint:SPTreeView>
    </SharePoint:SPRememberScroll>
     

    You can also change the “Site Hierarchy” link (NavigateUrl) to point somewhere other than “View All Site Content”. Some possibilities are your portal site or the Sites section of “View All Site Content”.

      <SharePoint:SPLinkButton runat="server" 
           NavigateUrl="~site/_layouts/viewlsts.aspx"
           id="idNavLinkSiteHierarchy"
           Text="<%$Resources:wss,treeview_header%>"  
           AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"
       />
     

     Perfomance note... The ExpandDepth requires SharePoint to drill down farther into the library and site structure, and this more complex SQL will be called on each page view.


    Mike Smith TechTrainingNotes.blogspot.com
    • Marked as answer by Chengyi Wu Wednesday, July 29, 2009 9:51 AM
    Tuesday, July 28, 2009 4:50 PM

All replies

  • You can enable the Tree View in Site Settings (Site Actions / Site Settings / Look and Feel / Tree View [/_layouts/navoptions.aspx]-- This navigation will vary slightly depending on your version of SharePoint [WSS or MOSS] and the Site Template you'vce used).

    The Tree View will only display the lists and libraries in the site. If you want a true Windows Explorer-like view, you can use the Explorer View for the Document Library itself.

    M.
    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    • Marked as answer by Chengyi Wu Wednesday, July 29, 2009 9:51 AM
    Tuesday, July 28, 2009 1:38 PM
  • If you need to show the folders inside a document library in a tree view format, check out the Doc Library Explorer web part at www.professionalsharepoint.com/dle
    • Proposed as answer by Paul Lucas Tuesday, September 1, 2009 5:58 PM
    Tuesday, July 28, 2009 4:34 PM

  • As Marc has said, just turn on the Tree View, and optionally turn off the Quick Launch by using the Site Settings options. You can also hide/show these in the master page.

    The Tree View is customizable, but not from Site Settings in the browser. Here are some of the things you can change by modifing the master page:

    Options to show or hide:

    <SharePoint:SPHierarchyDataSourceControl
      runat="server" id="TreeViewDataSource2" RootContextObject="Web"
      IncludeDiscussionFolders="true"
      ShowDocLibChildren="true"
      ShowFolderChildren="true"
      ShowListChildren="true"
      ShowWebChildren="true"
    />

    ShowFolderChildren – set to false to hide all folders within all lists and libraries
    IncludeDiscussionFolders – set to true to show individual discussions as folders in the tree view (ShowFolderChildren="false" overrides this option)
    ShowListChildren – set to false to hide all lists, including calendars, tasks and discussions
    ShowWebChildren – set to false to hide sub sites
    ShowDocLibChildren – set to false to hide document libraries 


    To control the depth (levels opened by default)

    <SharePoint:SPRememberScroll …… >
      <SharePoint:SPTreeView id="WebTreeView2" runat="server"
        ShowLines="true" ExpandDepth="10"
             …
      </SharePoint:SPTreeView>
    </SharePoint:SPRememberScroll>
     

    You can also change the “Site Hierarchy” link (NavigateUrl) to point somewhere other than “View All Site Content”. Some possibilities are your portal site or the Sites section of “View All Site Content”.

      <SharePoint:SPLinkButton runat="server" 
           NavigateUrl="~site/_layouts/viewlsts.aspx"
           id="idNavLinkSiteHierarchy"
           Text="<%$Resources:wss,treeview_header%>"  
           AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"
       />
     

     Perfomance note... The ExpandDepth requires SharePoint to drill down farther into the library and site structure, and this more complex SQL will be called on each page view.


    Mike Smith TechTrainingNotes.blogspot.com
    • Marked as answer by Chengyi Wu Wednesday, July 29, 2009 9:51 AM
    Tuesday, July 28, 2009 4:50 PM