locked
Provisioning a View to a page, How to Hide the Toolbar? RRS feed

  • Question

  • Hi Guys,

    Does anyone know how to hide the toolbar when provisioning a list view.

    I also want to provision a List View to a WebPart Page that would show the ListItems but not show the toolbar

     

    I know this works

        <File Path="defaultdws.aspx" Url="default2.aspx" >
          <Property
              Name="Title"
              Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
          <View BaseViewID="9" List="Lists/WorkflowTasks" WebPartZoneID="Left" WebPartOrder="1" DisplayName="My Tasks" >
            <![CDATA[
              <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
                  <Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
                  <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
                  <Title>My Requests</Title>
                  <Toolbar>None</Toolbar>
                  <NoAnnouncements>You have not created any CAR requests.</NoAnnouncements>
              </WebPart>
            ]]>
     
          </View>
        </File>

    BUt I have a column in my list which has custom rendering i.e. through fldtypes_mycol.xsl, and if I provision the webpart as above the column doesnt redner.

    But if I just provision the webpart as

    <File Path="defaultdws.aspx" Url="default2.aspx" >
          <Property
              Name="Title"
              Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
          <View BaseViewID="9" List="Lists/WorkflowTasks" WebPartZoneID="Left" WebPartOrder="1" DisplayName="My Tasks" />
    </File>

    Then my custom column renders fine, but how do I get rid of the toolbar?

     

    Appreciate your thoughts on this

     

    -Tariq


    • Edited by tariq86 Saturday, September 3, 2011 9:32 AM
    • Moved by Mike Walsh FIN Saturday, September 3, 2011 11:10 AM This is a customization question. (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Saturday, September 3, 2011 9:21 AM

Answers

  • Hi,

    This can be done oob without any customizations.

    Follow this:

    1. Add a list viewer webpart in any page

    2. Edit it and select no toolbar.

    Here it works.

    I hope this will help you out.


    Thanks, Rahul Rashu
    Saturday, September 3, 2011 1:03 PM

All replies

  • Hi,

    This can be done oob without any customizations.

    Follow this:

    1. Add a list viewer webpart in any page

    2. Edit it and select no toolbar.

    Here it works.

    I hope this will help you out.


    Thanks, Rahul Rashu
    Saturday, September 3, 2011 1:03 PM
  • Hi,

    try using BaseViewId="0"

     

    <File Path="defaultdws.aspx" Url="default2.aspx" >
          <Property
              Name="Title"
              Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
          <View BaseViewID="0" List="Lists/WorkflowTasks" WebPartZoneID="Left" WebPartOrder="1" DisplayName="My Tasks" />
    </File>

    also here is the article I posted on how you can do this programatically

    http://www.c-sharpcorner.com/UploadFile/bhushangawale/8694/

    hope this can help you


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale
    • Edited by Bhushan Gawale Saturday, September 3, 2011 1:56 PM added link
    Saturday, September 3, 2011 1:54 PM