3

I am working on developing an (ASP.NET) web part for SharePoint 2010.

I have a requirement to not to show the Appearance and Layout category which gets displayed by default in the web part tool pane (editor part).

So I am seeking pointer through which I can achieve this.

1 Answer 1

1

Those Properties are stock standard with any Sharepoint webpart as you know.

I have not tested the following code, but i'm pretty confident that this should work:

    public override Microsoft.SharePoint.WebPartPages.ToolPart[] GetToolParts()
    {
        Microsoft.SharePoint.WebPartPages.ToolPart[] myCustomToolparts = CreateMyCustomToolParts();

        //Removing the Base Method for calling creating the ToolParts should hide all the Built in Toolparts
        //return base.GetToolParts();

        return myCustomToolparts;
    }

If this does not work I'd suggest some Javascript/Jquery:

function hideToolParts(){
   $('#ctl00_MSOTlPn_EditorZone_Edit1g_55d19aab_008a_4d9a_9ca6_db3ad2137f20_LayoutCategory_IMAGEANCHOR').parent().hide();
   $('#ctl00_MSOTlPn_EditorZone_Edit1g_55d19aab_008a_4d9a_9ca6_db3ad2137f20_AppearanceCategory_IMAGEANCHOR').parent().hide();
}

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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