RelatedField - Classe
Specifies a relationship to a lookup field.
Hiérarchie d’héritage
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.RelatedField
Espace de noms : Microsoft.SharePoint.Client
Assemblys : Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll) Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)
Syntaxe
'Déclaration
Public Class RelatedField _
Inherits ClientObject
'Utilisation
Dim instance As RelatedField
public class RelatedField : ClientObject
Exemples
This code example displays the identifier of fields related to the Tasks list of the specified site.
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class RelatedFieldExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
List targetList = site.Lists.GetByTitle("Tasks");
// Get a collection of lookup fields that use this list as a data source
// and that have FieldLookup.IsRelationship set to true.
RelatedFieldCollection collRelatedField = targetList.GetRelatedFields();
clientContext.Load(collRelatedField);
clientContext.ExecuteQuery();
foreach (RelatedField relField in collRelatedField)
Console.WriteLine("Related Field ID: {0}", relField.FieldId);
}
}
}
Cohérence de thread
Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.