Skip to main content

MasterRowGetRelationNameEventArgs.RelationName Property

For the GridView.MasterRowGetRelationName event this property gets or sets the name of the level whose bound View will be used to represent the currently processed detail’s data.

For the GridView.MasterRowGetRelationDisplayCaption event this property gets or sets the display caption for the currently processed relation.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v23.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation


public string RelationName { get; set; }

Property Value

Type Description

A string value specifying the name (or display name for the GridView.MasterRowGetRelationDisplayCaption event) of the level for the currently processed relation.


When handling the GridView.MasterRowGetRelationName event, the RelationName property can be used to specify the View that will be used to represent the current detail clone. For relations defined by a data source, the RelationName property initially returns the name of the corresponding automatically generated level. For custom relations that are created by handling the GridView.MasterRowGetRelationCount event, the property’s value is initially an empty string.

Set the RelationName property to the name of a level residing within the GridControl.LevelTree tree. Each level has an associated View. This View will be used to represent the detail data for the current master row and relation index.

You can override the assigned value by handling the GridView.MasterRowGetLevelDefaultView event. This event receives the View that is specified by the RelationName property and enables it to be replaced with another View.

When handling the GridView.MasterRowGetRelationDisplayCaption event, the RelationName property can be used to specify the display caption for the processed relation (detail clone). This string will be displayed within detail tabs and detail tooltips. Initially this property contains a BaseView.ViewCaption string of the View that represents this relation. If BaseView.ViewCaption is set to an empty string, the RelationName property will initially contain the relationship’s name supplied via the GridView.MasterRowGetRelationName event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RelationName property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also