GridView.MasterRowEmpty Event
Enables you to specify whether a particular detail is empty. This event is in effect if the GridOptionsDetail.AllowExpandEmptyDetails option is set to false.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v24.2.dll
Declaration
Event Data
The MasterRowEmpty event's data class is MasterRowEmptyEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
IsEmpty | Gets or sets a value specifying whether a detail contains data. |
RelationIndex | Gets the relation index that identifies the affected detail. Inherited from CustomMasterRowEventArgs. |
RowHandle | Gets the handle of the currently processed master row in the current View. Inherited from CustomMasterRowEventArgs. |
Remarks
The MasterRowEmpty
event is in effect if the GridOptionsDetail.AllowExpandEmptyDetails option is set to false.
The Grid control fires this event for each master-detail relationship for each master row within the View. Handle the MasterRowEmpty
event to do the following:
- Mark a detail View that contains data as “empty” by setting the event’s
e.IsEmpty
parameter to true. - Mark a detail View that does not contain data as “not empty” by setting the event’s
e.IsEmpty
parameter to false. In this case, data for this View needs to be provided via the GridView.MasterRowGetChildList event.
gridView.MasterRowGetRelationCount += (s, e) => {
e.RelationCount = 2;
};
gridView.MasterRowEmpty += (s, e) => {
e.IsEmpty = false;
};
Users cannot access empty detail Views, either with detail tabs, or with detail tooltips (the visibility of these elements is specified by the event’s e.IsEmpty
parameter).
Read the following topic for detailed information and examples: Working with Master-Detail Relationships in Code.