Forum Discussion

Alen Pešikan's avatar
Alen Pešikan
Copper Contributor
Sep 16, 2016

List View WebPart Toolbar Type

Is there a way to change toolbar type on ListView WebPart via CSOM?

It doesn't seem to work

    • Alen Pešikan's avatar
      Alen Pešikan
      Copper Contributor

      Hi Paul,

      I have tried that. The thing is that so called 'Show Toolbar' mode, adds another attribute to toolbar node.

      It looks like Toolbar Type='Standard' ShowAlways='TRUE'.

      Any change one tries to make, doesn't effect toolbar behaviour.

      Event tried to change XmlDefinition directly and update the view. Nothing. :(

      Funny thing however, if you do that using Sharepoint designer, and add that attr directly it works.

      In addition I see that in PnP provisioning framework, toolbar is removed from view definition. 

      Object List Instance ExtractViews Method :

      // Toolbar is not supported

      var toolbarElement = schemaElement.Descendants("Toolbar").FirstOrDefault();
      if (toolbarElement != null)
      {
      toolbarElement.Remove();
      }

      • Deleted's avatar
        Deleted

        Hi Alen,

         

        that is strange you can not update the xml def but the view should be possible did it in my code as well.

        Maybe it changed with the latest csom or PNP.

         

        KR,

         

        Paul

Resources