none
remove Column header from List View Webpart

    Question

  • hi, i am having sharepoint 2010 Enterprise RTM trial on Windows server 2008 SP2. I wanted to know how a column header of a list in List View Webpart can be hide ?

    i have tried the following article:

    http://sharepointsolutionsrams.blogspot.com/2010/03/hide-column-header-in-sharepoint-list.html

    but i don't see any source editor in content Editor Weppart and also the Hidden button is disabled....

    Is it necessary to do this task from code ?

    Tuesday, October 12, 2010 12:53 PM

Answers

  • You need to use the visual editing window, not the code editor.  This is because when you first open the page, the XSL templates are not loaded into the code window. 

    In the visual editor, click on a column header.  You can delete it individually if you like.  Alternatively, look at the bottom of the screen to see how the tags nest.  You should be able to find and delete the tag that contains the entire row.  The tag should be something like <tr.ms-viewheader>.  You won't see it in the code view until you start making changes using the visual editor.

    For this change, advanced mode shouldn't be necessary, despite my earlier post to that effect.

    • Marked as answer by Ovais Ashraf Thursday, October 14, 2010 5:10 AM
    Wednesday, October 13, 2010 3:31 PM

All replies

  • You don't need code; you can do it from SharePoint Designer.
    Tuesday, October 12, 2010 5:59 PM
  • thanks for your response..

    can you elaborate your point further ?

    Wednesday, October 13, 2010 5:27 AM
  • Open the page containing the webpart in SharePoint Designer.  Click the "Advanced Mode" button.  Click on a column header.  You can delete it individually if you like.  Alternatively, look at the bottom of the screen to see how the tags nest.  You should be able to find and delete the tag that contains the entire row.  If your webpart is a XsltListViewWebPart, then that tag is probably something like <tr.ms-viewheader>.
    Wednesday, October 13, 2010 1:33 PM
  • thanks for your response...

    here is my webpart code copied from sharepoint 2010 designer:

    <WebPartPages:XsltListViewWebPart runat="server" Description="" ListDisplayName="" PartOrder="4" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="False" IsIncludedFilter="" DataSourceID="" Title="Company News" ViewFlag="8388617" NoDefaultStyle="" AllowConnect="True" FrameState="Normal" CatalogIconImageUrl="/_layouts/images/itgen.png" PageSize="-1" PartImageLarge="/_layouts/images/itgen.png" AsyncRefresh="False" ExportMode="NonSensitiveData" Dir="Default" DetailLink="/sites/GE/Lists/Company News" ShowWithSampleData="False" ListId="64ebcae5-1461-4bed-b53e-22e2ce651239" ListName="{64EBCAE5-1461-4BED-B53E-22E2CE651239}" FrameType="Default" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" ViewGuid="{C07BEB2A-8890-4951-B83A-4721E8B46909}" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" WebId="00000000-0000-0000-0000-000000000000" ViewContentTypeId="0x" InitialAsyncDataFetch="False" GhostedXslLink="main.xsl" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ListUrl="" ID="g_12e9bcb5_5771_4bd8_a7ac_4342ca2e0b68" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" TitleUrl="/sites/GE/Lists/Company News" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{C07BEB2A-8890-4951-B83A-4721E8B46909}" __AllowXSLTEditing="true" __designer:CustomXsl="fldtypes_Ratings.xsl" WebPart="true" Height="" Width=""><ParameterBindings>
                                                            <ParameterBinding Name="dvt_sortdir" Location="Postback;Connection" />
                                                            <ParameterBinding Name="dvt_sortfield" Location="Postback;Connection" />
                                                            <ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue="" />
                                                            <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection" />
                                                            <ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)" />
                                                            <ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)" />
                                                            <ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)" />
                                                            <ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)" />
                                                            <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
                                                            <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
                                                            <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
                                                        </ParameterBindings>
    <XmlDefinition>
                                                            <View Name="{C07BEB2A-8890-4951-B83A-4721E8B46909}" MobileView="TRUE" Type="HTML" Hidden="TRUE" TabularView="FALSE" DisplayName="" Url="/sites/GE/SitePages/Home.aspx" Level="1" BaseViewID="0" ContentTypeID="0x">
                                                                <Query>
                                                                    <OrderBy>
                                                                        <FieldRef Name="Modified" Ascending="FALSE"/>
                                                                    </OrderBy>
                                                                </Query>
                                                                <ViewFields>
                                                                    <FieldRef Name="LinkTitleNoMenu"/>
                                                                </ViewFields>
                                                                <RowLimit Paged="TRUE">30</RowLimit>
                                                                <Toolbar Type="None"/>
                                                            </View>
                                                        </XmlDefinition>
    <DataFields>
    </DataFields>
    </WebPartPages:XsltListViewWebPart>

    any suggestions ?

    Wednesday, October 13, 2010 2:38 PM
  • You need to use the visual editing window, not the code editor.  This is because when you first open the page, the XSL templates are not loaded into the code window. 

    In the visual editor, click on a column header.  You can delete it individually if you like.  Alternatively, look at the bottom of the screen to see how the tags nest.  You should be able to find and delete the tag that contains the entire row.  The tag should be something like <tr.ms-viewheader>.  You won't see it in the code view until you start making changes using the visual editor.

    For this change, advanced mode shouldn't be necessary, despite my earlier post to that effect.

    • Marked as answer by Ovais Ashraf Thursday, October 14, 2010 5:10 AM
    Wednesday, October 13, 2010 3:31 PM
  • thanks for your help, it worked out for me !
    Thursday, October 14, 2010 5:10 AM
  • Hi Clubok,

    I removed the nested tag and everything worked perfectly.  Here is what I don't get, when I view that list/view in a webpart on another page the column headings are still there.  

    I assume the webpart has something to do with it but I cannot find what/where.

    Do you have any idea?

    Kind regards

    Friday, October 07, 2011 10:23 AM
  • Hi Clubok,

    you need to modify the webpart on every page where you want it to be there, the above solution does not mean that the heading of the column removed from the webpart definition. 

    Regards,

    Ovais Ashraf

    Friday, October 07, 2011 9:08 PM
  • I don't have SharePoint Designer available, is there another way?  I was able to insert code to remove the header, but it removed it from every webpart on the page - I just want to remove it from a few of the webparts

    Tuesday, October 11, 2011 4:20 PM
  • SharePoint Designer is a free tool provided by microsoft. You can download it here:

    http://www.microsoft.com/download/en/details.aspx?id=16573

    Warm Regards,

    Adam


    adam

    Friday, March 02, 2012 3:52 PM
  • Sorry to rehash an old thread, but does anybody know of a way to do this with SharePoint 2013 since SharePoint Designer 2013 doesn't include a visual editor?  
    Monday, April 28, 2014 6:06 PM