A newer version of this page is available. Switch to the current version.

GridView.MasterRowGetRelationDisplayCaption Event

Enables the display caption for a particular relationship (detail clone) to be specified.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v18.2.dll


public event MasterRowGetRelationNameEventHandler MasterRowGetRelationDisplayCaption

Event Data

The MasterRowGetRelationDisplayCaption event's data class is MasterRowGetRelationNameEventArgs. The following properties provide information specific to this event:

Property Description
RelationIndex Gets the relation index that identifies the affected detail. Inherited from CustomMasterRowEventArgs.

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.

RowHandle Gets the handle of the currently processed master row in the current View. Inherited from CustomMasterRowEventArgs.


The MasterRowGetRelationDisplayCaption event is raised for individual detail clones. The current clone can be identified using the event’s CustomMasterRowEventArgs.RowHandle and CustomMasterRowEventArgs.RelationIndex parameters. Use the MasterRowGetRelationNameEventArgs.RelationName parameter to specify the display caption for the current detail. This string will be displayed within detail tabs and detail tooltips.

This event should be handled if different display captions should be used to represent matching relationships in different master rows. For instance, a master View has a single relationship. Its display caption should be “Relation 0” for the first row, “Relation 1” - for the second row, “Relation 2” - for the third row, etc. If only one display caption is required for the same relationship for all master rows, then this name can be supplied via the BaseView.ViewCaption property of the View that will represent this relationship. This View is determined via the GridView.MasterRowGetRelationName and/or GridView.MasterRowGetLevelDefaultView event.

Please refer to the Working with Master-Detail Relationships in Code document for additional information on controlling master-detail data representation via events.

See Also