none
Hiding default custom property categories on a web part RRS feed

  • Question

  • Hi All,
    I'm developing a web part with some custom properties. I have no use for the default attribute categories (Appearance, Layout, Advanced) and I'd like to simplify the UI for the user.

    Is there a way to hide the default property categories on the tool pane via code?
    Is there a way to have my property category open by default rather than the Appearance category?

    Thanks for any help
    Andy

    Thursday, January 20, 2011 4:22 PM

Answers

  • Hi, Andy

    If your web part inherit from asp.net web part (System.Web.UI.WebControl.WebParts.WebPart), you can't hide the default 3 categories.

    You can inherit your web part from sharepoint web part (Microsoft.SharePoint.WebPartPages.WebPart), and override "GetToolParts" function, you can change the order of your custom category and default categories, or hide the default categories. There are some samples in SharePoint SDK.

     

    Moderator Note: As an MVP you should know better than to propose your own posts. The Propose as Answer function is only for proposing the good answers of other people. Not for self-proposing. Please do not do this again.

    • Proposed as answer by Erucy Thursday, January 20, 2011 5:54 PM
    • Unproposed as answer by Mike Walsh FIN Thursday, January 20, 2011 6:01 PM
    • Edited by Mike Walsh FIN Thursday, January 20, 2011 6:02 PM Moderator Note added
    • Marked as answer by KeFang Chen Thursday, January 27, 2011 8:35 AM
    Thursday, January 20, 2011 5:53 PM

All replies

  • Hi, Andy

    If your web part inherit from asp.net web part (System.Web.UI.WebControl.WebParts.WebPart), you can't hide the default 3 categories.

    You can inherit your web part from sharepoint web part (Microsoft.SharePoint.WebPartPages.WebPart), and override "GetToolParts" function, you can change the order of your custom category and default categories, or hide the default categories. There are some samples in SharePoint SDK.

     

    Moderator Note: As an MVP you should know better than to propose your own posts. The Propose as Answer function is only for proposing the good answers of other people. Not for self-proposing. Please do not do this again.

    • Proposed as answer by Erucy Thursday, January 20, 2011 5:54 PM
    • Unproposed as answer by Mike Walsh FIN Thursday, January 20, 2011 6:01 PM
    • Edited by Mike Walsh FIN Thursday, January 20, 2011 6:02 PM Moderator Note added
    • Marked as answer by KeFang Chen Thursday, January 27, 2011 8:35 AM
    Thursday, January 20, 2011 5:53 PM
  • No estoy de acuerdo con la Nota Moderadora, me parece que es una excelente pregunta y un hueco funcional enorme en SharePoint, la pregunta me sirvio pero la respuesta si francamente poco, solo se ven las ganas de contestar algo solo por decir que sabe.
    Thursday, April 3, 2014 7:16 PM
  • The Moderator note is from 2011 and the Moderator is long gone. It's therefore pointless commenting on it now especially with a comment that missed the point of the Moderator note that had nothing to do with the answer given and everything to do with the person proposing *his own* post as the answer. But not as pointless as posting in Spanish to an English language forum. There are Spanish language forums for you to use (and less annoying Moderators or ex-Moderators there).

    SP 2013 "FAQ" (useful links): http://spf2013faq.mindsharp.com/default.aspx
    SP 2010 "FAQ" (useful links, book lists): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ; Books and Links) http://wssv3faq.mindsharp.com/default.aspx

    Friday, April 4, 2014 5:19 AM