Intersoft WebGrid Documentation
Relations Property
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > IObjectRelations Interface : Relations Property






Returns an ArrayList which contains the relations' definition of all your objects.

Syntax

Visual Basic (Declaration) 
ReadOnly Property Relations As ArrayList
Visual Basic (Usage)Copy Code
Dim instance As IObjectRelations
Dim value As ArrayList
 
value = instance.Relations
C# 
ArrayList Relations {get;}
Delphi 
read-only property Relations: ArrayList; 
JScript 
function get Relations : ArrayList
Managed Extensions for C++ 
__property ArrayList* get_Relations();
C++/CLI 
property ArrayList^ Relations {
   ArrayList^ get();
}

Example

C#Copy Code
public System.Collections.ArrayList Relations
{
    get
    {
        ArrayList relations = new ArrayList();
        
        relations.Add(new WebGridObjectRelation(typeof(CustomerCollection),
            "CustomerID", "Orders", typeof(OrderCollection), "CustomerID"));
        
        relations.Add(new WebGridObjectRelation(typeof(OrderCollection),
            "OrderID", "OrderDetails", typeof(OrderDetailCollection), "OrderID"));
            
        return relations;
    }
}

Remarks

In this property, you write codes to return an ArrayList which contains the relations' definition of all your objects.

The purpose of Relations getter property in IObjectRelations interface is simply to collect the definition of each relationship between one business entity and the other.

In this concept, you used the special WebGridObjectRelation object provided by WebGrid.NET for objects relation.

Use the WebGridObjectRelation object to provide the necessary information, such as:

  • The ParentCollection Type, such as CustomerCollection
  • The ParentMember property, such as CustomerID. In business object, the parent member is a public property having the same name as the property name.
  • The ChildCollection property, such as Orders. The child collection is a public property defined in the parent class which is used to get the collection of child objects.
  • The ChildCollection Type, such as OrderCollection
  • The ChildMember property, such as CustomerID. The child member is a public property defined in the child class (which is Order class in this context).

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.