如何使 SharePoint 2007 中 Web 部件的自定义属性排序到属性窗格的顶部?
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 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