如何在SharePoint 2007中创建webpart的自定义属性,排序到属性窗格的顶部?

时间:2009-04-15 22:01:55

标签: sharepoint sharepoint-2007 web-parts

在SharePoint 2007中,是否可以以编程方式将您创建的自定义属性排序到属性窗格的顶部?所以当有人编辑你的webpart时,它会显示在顶部,而不是默认情况下显示在底部,这样用户就不必滚动到底部了?

这是我的代码,供参考:

    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; }
    }

1 个答案:

答案 0 :(得分:2)

将CustomPropertyToolPart添加到数组时,请为其指定比WebPartToolPart更低的索引(0)。它应该按照将项添加到数组的顺序呈现。

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