共用方式為


ColumnAttribute.IsLookupValue Property

Gets or sets a value that indicates whether this field is a lookup field value.

Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

Syntax

'Declaration
Public Property IsLookupValue As Boolean
    Get
    Set
'Usage
Dim instance As ColumnAttribute
Dim value As Boolean

value = instance.IsLookupValue

instance.IsLookupValue = value
public bool IsLookupValue { get; set; }

Property Value

Type: System.Boolean
true, if the field is a lookup field; false otherwise.

Remarks

For example, a Team Members list has a Manager column that is a lookup field to a Managers list. The property representing the Manager column has a ColumnAttribute with IsLookupValue set to true. But there is also a ManagerID property that is decorated with a ColumnAttribute (even if there is no ManagerID column in the content type) with the IsLookupId set to true.

Examples

The following example shows IsLookupId and IsLookupValue in use:

[ContentType(Name="Item", Id="0x01", List="Team Members")]
[DataContract()]
public partial class TeamMembersItem : Item {
{
    [DataMember()]
    private LookupList<System.Nullable<int>> _managerId;
    
    [DataMember()]
    private LookupList<string> _managerTitle

    [Column(Name="Manager", Storage="_managerId", FieldType="User", IsLookupId=true, LookupDisplayColumn="Title")]
    public IList<System.Nullable<int>> ManagerId {
          get {
              return this._managerId;
          }
          set {
              this._managerId.Assign(value);
          }
     }
      
      [Column(Name="Manager", Storage="_managerTitle", FieldType="User", IsLookupValue=true, LookupDisplayColumn="Title")]
      public IList<string> ManagerTitle {
          get {
              return this._managerTitle;
          }
          set {
              this._managerTitle.Assign(value);
          }
      }
      
      // Other members omitted for readability.
}

See Also

Reference

ColumnAttribute Class

ColumnAttribute Members

Microsoft.SharePoint.Linq Namespace