[英]Customize in list of spgroup sharepoint programmatically
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.