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 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.

share|improve this question
add comment

1 Answer 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.

share|improve this answer
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.