Back to Devexpress

IRelationList.GetRelationName(Int32, Int32) Method

corelibraries-devexpress-dot-data-dot-irelationlist-dot-getrelationname-x28-system-dot-int32-system-dot-int32-x29.md

latest3.9 KB
Original Source

IRelationList.GetRelationName(Int32, Int32) Method

When implemented by a class, returns the name of a master-detail relationship.

Namespace : DevExpress.Data

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
string GetRelationName(
    int index,
    int relationIndex
)
vb
Function GetRelationName(
    index As Integer,
    relationIndex As Integer
) As String

Parameters

NameTypeDescription
indexInt32

An integer value that specifies the index of a master row in the data source.

| | relationIndex | Int32 |

An integer value that specifies the relationship.

|

Returns

TypeDescription
String

The name of a master-detail relationship.

|

Remarks

This method is called in turn for each relationship for each master row. You should handle it to provide the names for master-detail relationships. The names will be used to identify the master-detail relationships in other method and event calls.

The relationIndex parameter specifies a value between 0 and RelationCount - 1 , where RelationCount is the number of relationships for the currently processed row. The number of relationships is identified:

When implementing a data source for a GridControl, the names retrieved via the GetRelationName method are used to obtain the default pattern Views used to represent the detail data. The pattern Views are retrieved from the GridControl.LevelTree tree. At design time, you can use the Level Designer to associate pattern Views with specific relationship names. If you handle the GetRelationName method but there isn’t any pattern View associated with the supplied relationship’s name, the grid will use the current master View as the pattern for representing detail Views. The name retrieved is also displayed in detail tabs and detail tooltips, if these are enabled. If you need to customize the display names, you can use the BaseView.ViewCaption property or implement the IRelationListEx interface, and handle its IRelationListEx.GetRelationDisplayName method.

See Also

Working with Master-Detail Relationships in Code

IRelationList Interface

IRelationList Members

DevExpress.Data Namespace