SharePoint 设置Lookup 字段的值

如何设置Lookup字段的值, 首先我们同样需要了解SPFieldLookupValueCollection和SPFieldLookupValue, 这2个类的原理和之前所讲解到SPFieldUserValueCollection一样,这里就不多讲解

         /// <summary>
/// Convert dropdownList value to SPFieldLookupValue
/// </summary>
/// <param name="dropdownList">DropDownList Control</param>
/// <returns>SPFieldLookupValue</returns>
private SPFieldLookupValue setLookupValue(DropDownList dropdownList)
{
SPFieldLookupValue lookupValue = new SPFieldLookupValue(Convert.ToInt32(dropdownList.SelectedItem.Value), dropdownList.SelectedItem.Text);
return lookupValue;
}
上一篇:flutter圆角效果的实现


下一篇:读书笔记 effective c++ Item 38 通过组合(composition)为 “has-a”或者“is-implemented-in-terms-of”建模