GridView.CanExpandMasterRowEx(Int32, Int32) Method
Indicates whether a master row can be expanded to display a particular detail.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v22.2.dll
NuGet Package: DevExpress.Win.Grid
Declaration
Parameters
Name | Type | Description |
---|---|---|
rowHandle | Int32 | An integer value containing master row handle. |
relationIndex | Int32 | A zero-based integer specifying the index of the relationship in the data source. |
Returns
Type | Description |
---|---|
Boolean | true if the specified master row can be expanded; otherwise, false. |
Remarks
The CanExpandMasterRowEx method returns false in the following cases:
- The specified row is not a master row. This means that the GridView.IsMasterRow method returns false for the specified row.
- The specified detail is empty and the View prohibits opening empty details. Note that you can specify whether particular details contain data manually. Handle the GridView.MasterRowEmpty event for this purpose. When using this event, you can supply detail data by handling the GridView.MasterRowGetChildList event. If a particular detail is empty, it can still be opened if the View’s GridOptionsDetail.AllowExpandEmptyDetails option is enabled.
- The GridView.MasterRowExpanding event handler doesn’t allow you to open the specified detail.
The CanExpandMasterRowEx method’s return value specifies whether calling the GridView.SetMasterRowExpandedEx method with the same parameters will be a success. This method also affects visual elements’ availability. If false is returned for a particular detail, this detail’s link is not displayed within a detail tooltip and the corresponding detail tab is invisible.
Note
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the CanExpandMasterRowEx member must not be invoked for these Views. The CanExpandMasterRowEx member can only be used with Views that display real data within the Grid Control. Use the following methods to access these Views with which an end user interacts at runtime.
- 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.