GridView.SetMasterRowExpandedEx(Int32, Int32, Boolean) Method
Opens or closes a master row’s detail.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v19.1.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
rowHandle | Int32 | An integer value identifying the master row by its handle. |
relationIndex | Int32 | A zero-based integer specifying the index of the relationship in the data source. If set to -1, the method acts like the GridView.SetMasterRowExpanded method. |
expand | Boolean | true to open the specified detail; false to hide it. |
Remarks
The SetMasterRowExpandedEx method’s behavior depends on the initial state of the specified master row. If the expand parameter value is true, the following results are possible:
- The master row is collapsed initially. In this case, the method expands the master row and makes the specified detail visible.
- The master row is expanded initially. In this case, the method switches to the specified detail.
If the expand parameter value is false, the following can occur:
- The master row is collapsed. In this case, the method does nothing.
- The master row is expanded and the visible detail matches the specified one. In this case, the master row is collapsed.
- The master row is expanded and the visible detail doesn’t match the specified one. In this case, the method switches to the default detail. This detail is identified by the View’s GridView.DefaultRelationIndex property.
When attempting to change a master row’s expanded state, the GridView.MasterRowCollapsing and GridView.MasterRowExpanding events are raised. These events’ handlers may prohibit master row expanding/collapsing.
Please refer to the Master-Detail Relationships topic for additional information.
Note
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the SetMasterRowExpandedEx member must not be invoked for these Views. The SetMasterRowExpandedEx member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.
- GridControl.MainView - returns the top most View in a grid;
- GridControl.FocusedView - returns the focused View;
- GridControl.DefaultView - returns the currently maximized View;
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetMasterRowExpandedEx(Int32, Int32, Boolean) method.
Note
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.