如何使 SharePoint 2007 中 Web 部件的自定义属性排序到属性窗格的顶部?

发布于 2024-07-17 07:36:22 字数 630 浏览 3 评论 0原文

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

这是我的代码,供参考:

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千柳 2024-07-24 07:36:22

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

http://msdn.microsoft.com/ zh-cn/library/microsoft.sharepoint.webpartpages.webpart.gettoolparts.aspx

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文