Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have the following XsltListViewWebPart on a custom application page:

<WebPartPages:XsltListViewWebPart runat="server"
    Title="My Documents"
    ListUrl="Lists/MyDocuments"
    ViewGuid="{00000000-0000-0000-0000-000000000000}"
    ChromeType="TitleOnly"
    ShowToolbarWithRibbon="FALSE"
    >
    <XmlDefinition>
       <View MobileView="TRUE" Type="HTML" Level="1">
           <Query>
                <Where>
                    <Eq>
                        <FieldRef Name='MyDocMyId'/>
                        <Value Type='Text'>{controlMyID}</Value>
                    </Eq>
                </Where>
            </Query>
           <ViewFields>
               <FieldRef Name="DocIcon"/>
               <FieldRef Name="Title"/>
               <FieldRef Name="MyDocType"/>
               <FieldRef Name="MyDocDate"/>
               <FieldRef Name="MyDocNotes"/>
           </ViewFields>
           <RowLimit Paged="TRUE">30</RowLimit>
           <Toolbar Type="FreeForm"/>
       </View>
    </XmlDefinition>
    <parameterbindings>
       <!-- ootb bindings snipped -->
       <ParameterBinding Name="controlMyID" Location="Control(myDocMyId,Value)" DefaultValue="0" />
    </parameterbindings>
</WebPartPages:XsltListViewWebPart>

It's working great, except it is rendering with the New/Upload/Actions/Settings/View toolbar. If I remove the ViewGuid attribute, the toolbar goes away, but the web part renders using 2007-ish table-based HTML.

Is there a way to configure a XsltListViewWebPart using a custom view so that it has the same XSLT look and feel, but does not show the toolbar?

share|improve this question
add comment

2 Answers

You can think of using Permissions to hide the toolbar. I guess the toolbar is displayed only if the role has "Full Control" and/or "Design". I assume most of your site users will not have these permissions? Removing them should get rid of the toolbar!

share|improve this answer
add comment

Change the <Toolbar Type="FreeForm"/> to <Toolbar Type="None"/>

share|improve this answer
    
No change. And, according to MSDN, the only values are Standard and FreeForm. –  Rich Bennema Mar 12 '12 at 15:57
    
try removing the toolbar attribute entirely. –  Vardhaman Deshpande Mar 12 '12 at 16:10
    
No difference there either. My first version didn't have the Toolbar element or the ShowToolbarWithRibbon attribute. Adding them didn't change anything, but I included them in my question for completeness. –  Rich Bennema Mar 12 '12 at 16:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.