Skip to main content

GridControl.SetMasterRowExpanded(Int32, Boolean, DetailDescriptorBase) Method

Changes the expanded state for a specified master row and, optionally, shows a specified Detail.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v14.2.dll

#Declaration

public void SetMasterRowExpanded(
    int rowHandle,
    bool expand,
    DetailDescriptorBase descriptor = null
)

#Parameters

Name Type Description
rowHandle Int32

An integer value specifying the master row by its handle.

expand Boolean

true to expand the specified row; false to collapse it.

#Optional Parameters

Name Type Default Description
descriptor DetailDescriptorBase

null

Optional. A DetailDescriptorBase object specifying the detail section to be made visible when expanding a master row. If the specified object doesn't represent a detail for the specified master row, then this parameter is ignored. The same happens if you pass null (Nothing in Visual Basic).

#Remarks

Use this method to expand or collapse master rows from code or switch between visible details. This might become useful if you are providing your own control for master row management while disabling the TableView.ShowDetailButtons option. Another way to use this option is when implementing custom automated detail visibility management.

This method may not expand or collapse the master row if these actions are overridden in GridControl.MasterRowExpanding and/or GridControl.MasterRowCollapsing event handers.

To determine a master row's expanded state and currently visible detail, use the GridControl.IsMasterRowExpanded and GridControl.GetVisibleDetailDescriptor (GridControl.GetVisibleDetail) methods.

See Also