GridView.MasterRowGetRelationCount Event
Enables you to specify the number of details for individual master rows.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v21.1.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Grid
Declaration
[DXCategory("MasterDetail")]
public event MasterRowGetRelationCountEventHandler MasterRowGetRelationCount
Event Data
The MasterRowGetRelationCount event's data class is MasterRowGetRelationCountEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
RelationCount | Gets or sets the number of relations for the master row. |
RowHandle | Gets a value identifying a master row. |
Remarks
Handle the MasterRowGetRelationCount event when implementing dynamic detail data loading. The event fires for master rows so that you can specify the number of details the processed row will have. The master row is identified by the MasterRowGetRelationCountEventArgs.RowHandle parameter. The number of details can be specified via the MasterRowGetRelationCountEventArgs.RelationCount parameter.
Initially the MasterRowGetRelationCount event fires with the RowHandle parameter set to GridControl.InvalidRowHandle. To enable master-detail mode, you need to set the RelationCount parameter to a positive value when the RowHandle is set to this value. Otherwise, master-detail mode will not be invoked.
Please refer to the Working with Master-Detail Relationships in Code document for additional information on implementing dynamic detail data loading.