简体   繁体   English

以编程方式自定义spgroup共享点列表

[英]Customize in list of spgroup sharepoint programmatically

I want to add column (Lookup Field) to list of SharePoint Group programmatically. 我想以编程方式将列(查找字段)添加到SharePoint组列表中。 Like this image from administration. 喜欢这张来自行政部门的图片。

从Sp组页面>设置>列表设置

You can just get the SPList object through the ID of the list. 您可以通过列表的ID来获取SPList对象。 When you click on the link your marked in red you will see the GUID in the Url. 单击链接上标记为红色的链接时,您将在Url中看到GUID。

Copy this ID and use this code to obtain the SPList object. 复制此ID并使用此代码获取SPList对象。

SPList list = web.Lists.GetList(new Guid("<your copied ID>"), false);
Console.WriteLine(list.Title);

You can then use the SPList object to add columns like any other normal list (through the Fields property which returns an SPFieldCollection). 然后,您可以使用SPList对象添加列,就像其他任何普通列表一样(通过返回SPFieldCollection的Fields属性)。 Use list.Fields.Add() to add existing columns. 使用list.Fields.Add()添加现有列。

You might have to create the site columns first (or use an overload method to create it at once) 您可能必须先创建站点列(或使用重载方法立即创建它)

See here: https://msdn.microsoft.com/en-us/library/office/aa540133%28v=office.14%29.aspx 参见此处: https : //msdn.microsoft.com/zh-cn/library/office/aa540133%28v=office.14%29.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式将AD组添加到SharePoint 2010 SPGroup? - How to add AD group to SharePoint 2010 SPGroup programmatically? 以编程方式创建SharePoint列表 - Programmatically create SharePoint list 以编程方式列出项目多用户权限(sharepoint) - List Item multiple users permissions programmatically (sharepoint) 以编程方式将用户权限添加到Sharepoint中的列表 - Programmatically add user permission to a list in Sharepoint 通过编程将SharePoint列表项移动到同一列表中存在的文件夹中? - Move SharePoint list items into folders that exists in the same list programmatically? Sharepoint 2010 以编程方式更新事件处理程序中的列表项 - Sharepoint 2010 Programmatically Update List Item in Event Handler 以编程方式将Sharepoint列表项从一个站点删除到另一个站点 - Deleting Sharepoint list items from one site to another programmatically 以编程方式检索 Sharepoint 列表项的版本历史更改 - Programmatically retrieve version history changes of an Sharepoint list item 以编程方式将Excel文件导入SharePoint自定义列表UnauthorizedAccessException - Importing an Excel file to a SharePoint custom list programmatically UnauthorizedAccessException sharepoint 2010自定义新列表表单(列表表单Web部件)按钮 - sharepoint 2010 customize new list form (list form web part) buttons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM