Skip to main content
A newer version of this page is available. .

GridView.SetRowExpanded(Int32, Boolean) Method

Expands or collapses the specified group row.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v19.1.dll

Declaration

public void SetRowExpanded(
    int rowHandle,
    bool expanded
)

Parameters

Name Type Description
rowHandle Int32

An integer value identifying the group row by its handle.

expanded Boolean

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

Remarks

The SetRowExpanded method raises either the GridView.GroupRowExpanding or GridView.GroupRowCollapsing event. These events allow you to prevent the row from being expanded or collapsed respectively. If a row has been expanded or collapsed successfully, the GridView.GroupRowExpanded or GridView.GroupRowCollapsed event is raised respectively.

If the specified handle points to a data row, the method does nothing.

To expand/collapse group rows recursively, use another method overload.

Please refer to the Working with Groups in Code topic for additional information.

Note

Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the SetRowExpanded member must not be invoked for these Views. The SetRowExpanded 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.

See Also