locked
Is it possible to hide column header in list view webparts?

    Question

  • I can't seem to find a way to hide the column header of a list view web part.  Is it possible?  It appears that OOB the only list that doesn't show the column header in web parts is the Link List.

     

    Friday, May 02, 2008 3:34 PM

Answers

  • I beleive the Style on the view affects this.  So depending on what style you choose, you get a different look and feel.  I don't think there is a Style that comes out of the box that does not display the headers, but one could probably be built relatively easily.
    Friday, May 02, 2008 6:44 PM
  • In addition to John's response, you might be able to do it using sharepoint designer and data view web part.

     

     

    Saturday, May 03, 2008 12:53 PM

All replies

  • I beleive the Style on the view affects this.  So depending on what style you choose, you get a different look and feel.  I don't think there is a Style that comes out of the box that does not display the headers, but one could probably be built relatively easily.
    Friday, May 02, 2008 6:44 PM
  • In addition to John's response, you might be able to do it using sharepoint designer and data view web part.

     

     

    Saturday, May 03, 2008 12:53 PM
  • Thanks a lot guys.  Data Form Web Part is indeed the path I went with. 

     

    Saturday, May 03, 2008 3:56 PM
  • Hello


    To change the view ex: either remove toolbar or header, w
    e have to use reflection on the actual webpart to get the current view and then modify it.

     to remove header 1) use reflection, 2) spView.ViewHeader = string.Empty;


    Cheers

     


    Momo
    Saturday, November 14, 2009 8:17 PM
  • Hello

    If you want to hide or remove the header from list view web part. You have to assign minimal header CAML string to the header view. So that you prevent having an extra closing table at the end of the list view web part.  Here is PowerShell code that I have wrote in order to test this solution :

    $pageUrl  = "http://momo/pages/listViewWebPart .aspx "

    $site = new-object microsoft.sharepoint.spsite

    $web = $site.OpenWeb()

    $file = $web.GetFile('/pages/listViewWebPart .aspx')

    $manager =

    $file.GetLimitedWebPartManager(

    [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)

    $manager.WebParts | Format-List Title, Id

    $wp = $manager.WebParts['g_4444']

    $wptype = $wp.GetType()

    $viewProperty = $wptype.GetProperty('View',[Reflection.BindingFlags]'NonPublic,Instance')

    $view = $viewProperty.GetValue($wp,$null)

    $view.ViewHeader = "<HTML><![CDATA[<TABLEID='onetidDoclibViewTbl0]]></HTML><HTML><![CDATA['width='100%'border=0cellspacing=0cellpadding=1rules=rows><TRVALIGN=TOP><FORM>]]></HTML><HTML><![CDATA[</FORM></TR>]]> </HTML>"

    $view.Update()

    $web.Dispose()

    $site.Dispose()

     

    Note : Please replace values of lines in blue by your own values.

    Cheers


    Momo
    Friday, March 12, 2010 9:39 PM
  • Add a Content Editor Web part on the Page. Add following HTML under Source Editor :

    <style>
    .ms-viewheadertr { display: none;}
    </style>

    Also, set Layout as "Hidden" for Content Editor.

    This will hide the column headers.

    Wednesday, September 22, 2010 12:52 PM