Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFElement.Parent Property

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFElement.Parent Property
This property returns the primary parent AFElement that owns the element if it is referenced by another element.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public AFElement Parent { get; set; }
Public Property Parent As AFElement
	Get
	Set

Dim instance As AFElement
Dim value As AFElement

value = instance.Parent

instance.Parent = value
public:
property AFElement^ Parent {
	AFElement^ get ();
	void set (AFElement^ value);
}
member Parent : AFElement with get, set

Property Value

Type: AFElement
Returns the primary parent AFElement that owns the element if it is referenced by another element, regardless of the current QueryDate. If , then this element does not belong to any element or has a primary parent of the AFDatabase.

Exceptions

ExceptionCondition
ArgumentException This exception is thrown when attempting to set the parent to an invalid value. If the current parent has a Composition, then the parent cannot be changed. If setting the parent to , then this must be a root-level element (see IsRoot). Otherwise, the new parent must be an existing parent with a reference strength that is not Weak.

Remarks

If the IsRoot property is and this property is , then the primary parent of the element is the Database.

When setting this property, it should be set to an existing parent element (returned from one of the GetParents Overload method) or to if setting the Database as the primary parent. If set to an invalid element or to the database when not a root element, then the server will automatically select a new parent element when saved to the server.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in