skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class ObjectRelation

Represents a relationship between data objects, providing hierarchical data structure support for data binding scenarios in Telerik WinControls.

Inheritance
System.Object
ObjectRelation
DataSetObjectRelation
SelfReferenceRelation
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll

Syntax

public class ObjectRelation
Remarks

The ObjectRelation class enables the creation of master-detail relationships between different data sources, including DataTable, DataView, BindingSource, and other enumerable collections.

This class is particularly useful in scenarios where you need to establish parent-child relationships between data entities, such as displaying hierarchical data in grid controls or tree structures.

Properties

ChildRelationNames

Declaration
public virtual string[] ChildRelationNames { get; }
Property Value
System.String[]

ChildRelations

Declaration
public ObjectRelationCollecion ChildRelations { get; }
Property Value
ObjectRelationCollecion

List

Declaration
public object List { get; }
Property Value
System.Object

Name

Declaration
public string Name { get; protected set; }
Property Value
System.String

Parent

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

Declaration
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
public virtual string[] ParentRelationNames { get; }
Property Value
System.String[]

Properties

Declaration
public PropertyDescriptorCollection Properties { get; protected set; }
Property Value
System.ComponentModel.PropertyDescriptorCollection

Tag

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

Declaration
public object Tag { get; set; }
Property Value
System.Object

An System.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
public static ObjectRelation GetObjectRelation(object list)
Parameters
System.Object list

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
public static ObjectRelation GetObjectRelation(object dataSource, string dataMember)
Parameters
System.Object dataSource

The main data source object containing the data member.

System.String dataMember

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
protected virtual void Initialize()

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.