zoukankan      html  css  js  c++  java
  • How to remove the ribbon tabs in list forms in SharePoint 2010


    How to remove the ribbon tabs in list forms in SharePoint 2010

    In this article we will be seeing how to remove the tab and the group from the ribbon interface in list form.

    I have a custom list and items are added to that.

    When you view the item the display form looks like the following which has two groups "Manage" and "Actions" and each group has few tabs. 

    RibbonShare1.gif

    Here we will be seeing how to remove the tabs and the group from the ribbon interface in the list display form.
    Steps Involved:

    • Open Visual Studio 2010.
    • Go to File => New => Project.
    • Select Empty SharePoint Project template from the installed templates.

      RibbonShare2.gif


    • Enter the Name for the project and click on Add.
    • Right click on the solution =>Add => New item.
    • Select Empty Element template from the installed templates.

      RibbonShare3.gif
       
    • My entire solution looks like the following.

      RibbonShare4.gif
         
    • Replace Elements.xml with the following code.

                <?xml version="1.0" encoding="utf-8"?>
                <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
                         <CustomAction
                          Id="RemoveTabEditItem"
                          Location="CommandUI.Ribbon"
                          RegistrationId="100"
                          RegistrationType="List">
                                   <CommandUIExtension>
                                            <
      CommandUIDefinitions>
                                                      <
      CommandUIDefinition
                                                       Location="Ribbon.ListForm.Display.Manage.EditItem" />
                                            </CommandUIDefinitions>
                                   </
      CommandUIExtension>
                         </
      CustomAction>
                         <
      CustomAction
                          Id="RemoveGroupActions"
                          Location="CommandUI.Ribbon"
                          RegistrationId="100"
                          RegistrationType="List">
                                   <CommandUIExtension>
                                            <
      CommandUIDefinitions>
                                                      <
      CommandUIDefinition
                                                       Location="Ribbon.ListForm.Display.Actions" />
                                            </CommandUIDefinitions>
                                   </
      CommandUIExtension>
                         </
      CustomAction>     
                </
      Elements>
       
    • Removing the Edit Item Tab: Location - Ribbon.ListForm.Display.Manage.EditItem

      RibbonShare5.gif
       
    • Removing the Actions group: Location - Ribbon.ListForm.Display.Actions

      RibbonShare6.gif
       
    • For Default Server Ribbon Customization Locations refer http://msdn.microsoft.com/en-us/library/ee537543.aspx.  
  • 相关阅读:
    FBWF和EWF的对比
    还原数据库备份文件时,关于“System.Data.SqlClient.SqlError:媒体集有2个媒体簇,但只提供了1个。必须提供所有成员”的处理方式
    C#基础(八)——C#数据类型的转换
    C#基础(七)——静态类与非静态类、静态成员的区别
    C#基础(六)——值类型与引用类型
    C#基础(五)——类中私有构造函数作用
    C#基础(四)——ref与out的区别
    C#基础(三)—重载与覆盖
    oracle exists和 not exists 的用法
    easyUI 常见问题点
  • 原文地址:https://www.cnblogs.com/sunjunlin/p/2316677.html
Copyright © 2011-2022 走看看