列表的 Sharepoint webpart 组合框 [英] Sharepoint webpart combobox of lists
本文介绍了列表的 Sharepoint webpart 组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个基于列表的 webpart,但我正在尝试创建一个包含共享点列表列表的下拉列表,以便当用户编辑页面并选择修改共享 webpart"时,他们能够选择一个列表项,然后将其解析回 webpart.
I have a webpart that works off of a list but what I'm trying to do create a dropdown that contains a list of sharepoint lists so that when the user edits the page and selects 'modify shared webpart' they are able to choose a list item and that gets parsed back to the webpart.
感谢任何示例或示例链接!
Any examples or links to examples appreciated!
谢谢
丹
推荐答案
您要查找的内容称为 Toolpart.查看此示例以获得教程关于如何创建一个.
What you are looking for is called a Toolpart. Take a look at this example for a tutorial on how to create one.
总的来说,您的一般步骤是:
Overall, your general steps will be:
- 创建继承自
Microsoft.SharePoint.WebPartPages.ToolPart
的自定义 Toolpart 类 - 在您的自定义 Toolpart 中,覆盖
CreateChildControls
,编写代码以遍历 SPWeb 中的列表,并将它们添加到 DropDownList - 在您的 webpart 中,覆盖
GetToolParts
并添加您的自定义 ToolPart,使其显示在右侧
- Create your custom Toolpart class inheriting from
Microsoft.SharePoint.WebPartPages.ToolPart
- In your custom Toolpart, override
CreateChildControls
, write the code to iterate over the lists in your SPWeb, and add those to a DropDownList - In your webpart, override
GetToolParts
and add your custom ToolPart so that it shows up in the right hand side
这篇关于列表的 Sharepoint webpart 组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文