SPGroupCollection.GetByID Method
Returns a group from the collection based on the member ID of the group.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
<ClientCallableMethodAttribute(Name := "GetById", CacheReturnValue := True, _
ReturnObjectIdentity := True)> _
<ClientCallableExceptionConstraintAttribute(FixedId := "System.UnauthorizedAccessException$-2147024891", _
ErrorType := GetType(UnauthorizedAccessException), ErrorCode := , Condition := "Access is denied.")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "Microsoft.SharePoint.SPException$-2146232832", _
ErrorType := GetType(SPException), ErrorCode := , Condition := "Group cannot be found.")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "1", ErrorType := GetType(ArgumentException), _
Condition := "Unknown/incorrect group collection type to be initialized.", _
ErrorCode := )> _
Public Function GetByID ( _
id As Integer _
) As SPGroup
'Usage
Dim instance As SPGroupCollection
Dim id As Integer
Dim returnValue As SPGroup
returnValue = instance.GetByID(id)
[ClientCallableMethodAttribute(Name = "GetById", CacheReturnValue = true, ReturnObjectIdentity = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "System.UnauthorizedAccessException$-2147024891",
ErrorType = typeof(UnauthorizedAccessException), ErrorCode = , Condition = "Access is denied.")]
[ClientCallableExceptionConstraintAttribute(FixedId = "Microsoft.SharePoint.SPException$-2146232832",
ErrorType = typeof(SPException), ErrorCode = , Condition = "Group cannot be found.")]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", ErrorType = typeof(ArgumentException),
Condition = "Unknown/incorrect group collection type to be initialized.",
ErrorCode = )]
public SPGroup GetByID(
int id
)
Parameters
id
Type: System.Int32A 32-bit integer that specifies the member ID.
Return Value
Type: Microsoft.SharePoint.SPGroup
An SPGroup object that represents the group.
Remarks
The value of the id parameter corresponds to the unique member ID for the group, which is contained in the ID property of the SPMember class.