ObjectRelation
Represents a relationship between data objects, providing hierarchical data structure support for data binding scenarios in Telerik WinControls.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class ObjectRelation
Inheritance: objectObjectRelation
Derived Classes:
Properties
public virtual string[] ChildRelationNames { get; }
public ObjectRelationCollecion ChildRelations { get; }
Gets the parent relation of this object relation in the hierarchical structure.
public ObjectRelation Parent { get; protected set; }
The ObjectRelation that is the parent of this relation,
or null if this is a root-level relation.
This property enables navigation up the hierarchy in master-detail data scenarios.
public virtual string[] ParentRelationNames { get; }
public PropertyDescriptorCollection Properties { get; protected set; }
Gets or sets an object that contains additional data associated with this relation.
public object Tag { get; set; }
An object that contains data to associate with this relation.
The default value is null.
The Tag property can be used to store any additional information that you want to associate with the object relation. This property is not used internally by the ObjectRelation class.
Methods
Creates an ObjectRelation instance for a specific data member within a data source.
public static ObjectRelation GetObjectRelation(object dataSource, string dataMember)
The main data source object containing the data member.
dataMemberstringThe name of the specific data member or table within the data source to create a relation for.
Returns:An ObjectRelation instance for the specified data member, or null
if the data member cannot be resolved.
This factory method is useful for creating relations to specific tables within DataSets or other complex data sources that contain multiple related data entities.
Creates an appropriate ObjectRelation instance based on the type of the specified list.
public static ObjectRelation GetObjectRelation(object list)
The data source object to create a relation for. Can be a BindingSource, DataTable, DataView, or any other enumerable collection.
Returns:An ObjectRelation instance appropriate for the specified data source type. Returns a DataSetObjectRelation for DataTable or DataView objects, otherwise returns a standard ObjectRelation.
This factory method automatically determines the most appropriate ObjectRelation type based on the input data source, handling BindingSource unwrapping and DataSet-specific relation creation.
protected virtual void Initialize()