Change the Category for Web Part to be displayed
Asked Answered
S

2

11

In Sharepoint 2010, is there any way to change the category where custom web parts created in VS2010 to be placed.

VS2010 is putting the custom web part in "Custom" category by default. I'm curious that, is there any way for us to change it, for example "MyCustomWebParts" category.

incase I couldn't made myself clear:

here

Submicroscopic answered 7/4, 2011 at 12:34 Comment(0)
H
14

You can change file Elements.xml. Into File tag add line:

<Property Name="Group" Value="MyCustomWebPart" />

or

Select “Site Actions” >> “Site Settings” >> “Modify All Site Settings”. Click the “Web Parts” link in the Galleries group. Open your webpart for edit. In the Group section, check the “Specify your own value” option and type in a group name (e.g. MyCustomWebParts)

Handoff answered 7/4, 2011 at 17:25 Comment(1)
Is there a way to do this using by decorating my WebPart class with some attribute?Minicam
C
0

There is! In the .webpart file, under the Module/File path, add a tag like this:

<Property Name="Group" Value="My Custom Group"/>

That's all there is to it!

Codel answered 7/4, 2011 at 17:10 Comment(1)
Completely valid solution and was posted before the accepted one. Upvote!Gallup

© 2022 - 2024 — McMap. All rights reserved.