Search code examples
c#sharepoint-2010web-partstoolpart

Programmatically set Toolpart layout


I am following this tutorial for creating a tool part: http://www.dhirajranka.com/?p=420

What I still have to understand is how to: 1) add a title to the custom tool part 2) adjust the various components (buttons dropdown lists etc)

I have been spoiled with the designer view but now that I cannot use it I am a bit lost.

regards


Solution

  • you need to add this line to your webpart's properties:

    [ToolboxItemAttribute(false), WebBrowsable(true), WebDescription("Set the list name to use."), WebDisplayName("List Name"), Personalizable(PersonalizationScope.User)]
    public string ListName{ 
        get{return customListName;}
        set{customListName = value;}
    }
    

    This works, right now I have this running over my SharePoint.

    Best regards!