views:

173

answers:

1

In SharePoint 2007, is it possible to programmatically sort the custom property you created to the top of the property pane? So when someone edits your webpart it would show at the top, rather than at the bottom by default, so that the user wouldn't have to scroll to the bottom?

Here's my code, for reference:

    private string _strMainFolder = "Reports";

    [WebBrowsable(true)]
    [WebDisplayName("Reports SharePoint List Name")]
    [SPWebCategoryName("Report WebPart Configuration")]
    [WebPartStorage(Storage.Shared)]
    [WebDescription("Enter the SharePoint List's name that you want to use.")]
    [Personalizable(PersonalizationScope.Shared)]
    public string strMainFolder
    {
        get { return _strMainFolder; }
        set { _strMainFolder = value; }
    }
+2  A: 

When you add your CustomPropertyToolPart to the array, give it a lower (0) index than the WebPartToolPart. It should render in the order the items are added to the array.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.gettoolparts.aspx

vinny