In a Webpart I have some customs properties. For the strings, booleans and enums, is all ok, but I have a problem with the selects (comboboxes).

To use a select I needed to create a Toolpart that contains it. And then I added this toolpart this way:

public override ToolPart[] GetToolParts()
            ToolPart[] toolparts = new ToolPart[3];
            WebPartToolPart wptp = new WebPartToolPart();
            CustomPropertyToolPart custom = new CustomPropertyToolPart();
            toolparts[0] = wptp;
            toolparts[1] = custom;
            toolparts[2] = new SelectToolPart(); // MY NEW TOOLPART   

            return toolparts;

But I want that this select appears inside the custom menu (like the other "normal" options).

Better I add a image that I think is easy to understand:


How can I do this?

1 Answer 1


Since you use more complex data types, the toolpart manager cannot convert the data type to a field in the toolpart (as you do)

When you add your custom toolpart this will inevitable be placed over or under your OOB toolpart (you handle where in your toolParts array).

However if you add your other "simple data type" custom properties to the toolpart as well, you should be able to achieve what you want.

NOTE: it is considered a best practice for SP2010 to prefer ASP.NET WebParts over SharePoint web parts (and hence EditorParts over ToolParts) unless there is a good reason not to.)

  • Ok, I undestand that it's not possible to do this. I'll consider a new aproach and put the code outside configuration menu.Thanks
    – user674887
    Commented Aug 23, 2011 at 11:07
  • I havent explained clear enough then: you definately can do this, but you need to place all your properties in the toolpane (and hence dont make them [Browsable]. Commented Aug 23, 2011 at 14:07

Your Answer

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

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