GridView.CollapseMasterRow(Int32, Int32) Method
Collapses a specific detail View which belongs to the specific master row.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
row |
Int32 | The handle of the master row to collapse. |
relation |
Int32 | A zero-based integer specifying the index of the relationship in the data source. |
#Remarks
When the grid displays a several master-detail relationships, you can expand or collapse the specific detail Views using the CollapseMasterRow method. If master row contains only one detail View, the method collapses the master row, else the method displays the next existing detail View belonging to this master row.
Also the specific detail View can be collapsed by calling the GridView.SetMasterRowExpandedEx method with a boolean parameter set to false.
When the relation index is set to -1, the CollapseMasterRow method collapses all opened detail Views, which belong to the specified master row. To perform the same action you can call another overload of the CollapseMasterRow method with one parameter, specifying the master row to collapse.
Before the master row is collapsed, the GridView.MasterRowCollapsing event occurs. Handle this event to prevent the collapse of a specific master row. After the master row has collapsed, the GridView.MasterRowCollapsed event fires.
To collapse all opened detail Views, use the GridView.CollapseAllDetails method.
Note
Detail pattern Views do not contain data and they are never displayed within Xtra
- Grid
Control. - returns the top most View in a grid;Main View - Grid
Control. - returns the focused View;Focused View - Grid
Control. - returns the currently maximized View;Default View - the sender parameter of View specific events;
- Grid
View. - returns a detail clone View for a specific master row.Get Detail View