Class
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:

cs-api-definition
public class ObjectRelation

Inheritance: objectObjectRelation

Derived Classes: DataSetObjectRelationSelfReferenceRelation

Properties

ChildRelationNames

Declaration

cs-api-definition
public virtual string[] ChildRelationNames { get; }

Property Value

string[]

ChildRelations

Declaration

cs-api-definition
public ObjectRelationCollecion ChildRelations { get; }

Property Value

ObjectRelationCollecion

List

Declaration

cs-api-definition
public object List { get; }

Property Value

object

Name

Declaration

cs-api-definition
public string Name { get; protected set; }

Property Value

string

Parent

Gets the parent relation of this object relation in the hierarchical structure.

Declaration

cs-api-definition
public ObjectRelation Parent { get; protected set; }

Property Value

ObjectRelation

The ObjectRelation that is the parent of this relation, or null if this is a root-level relation.

Remarks

This property enables navigation up the hierarchy in master-detail data scenarios.

ParentRelationNames

Declaration

cs-api-definition
public virtual string[] ParentRelationNames { get; }

Property Value

string[]

Properties

Declaration

cs-api-definition
public PropertyDescriptorCollection Properties { get; protected set; }

Property Value

PropertyDescriptorCollection

Tag

Gets or sets an object that contains additional data associated with this relation.

Declaration

cs-api-definition
public object Tag { get; set; }

Property Value

object

An object that contains data to associate with this relation. The default value is null.

Remarks

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

GetObjectRelation(object)

Creates an appropriate ObjectRelation instance based on the type of the specified list.

Declaration

cs-api-definition
public static ObjectRelation GetObjectRelation(object list)

Parameters

list

object

The data source object to create a relation for. Can be a BindingSource, DataTable, DataView, or any other enumerable collection.

Returns

ObjectRelation

An ObjectRelation instance appropriate for the specified data source type. Returns a DataSetObjectRelation for DataTable or DataView objects, otherwise returns a standard ObjectRelation.

Remarks

This factory method automatically determines the most appropriate ObjectRelation type based on the input data source, handling BindingSource unwrapping and DataSet-specific relation creation.

GetObjectRelation(object, string)

Creates an ObjectRelation instance for a specific data member within a data source.

Declaration

cs-api-definition
public static ObjectRelation GetObjectRelation(object dataSource, string dataMember)

Parameters

dataSource

object

The main data source object containing the data member.

dataMember

string

The name of the specific data member or table within the data source to create a relation for.

Returns

ObjectRelation

An ObjectRelation instance for the specified data member, or null if the data member cannot be resolved.

Remarks

This factory method is useful for creating relations to specific tables within DataSets or other complex data sources that contain multiple related data entities.

Initialize()

Declaration

cs-api-definition
protected virtual void Initialize()