Skip to main content
Tab

ASPxGridView.CollapseRow(Int32, Boolean) Method

Collapses the specified group row and optionally its child group rows at all nesting levels.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public void CollapseRow(
    int visibleIndex,
    bool recursive
)

Parameters

Name Type Description
visibleIndex Int32

The row’s visible index.

recursive Boolean

true to collapse child group rows at all nesting levels of the specified group row; false or undefined to preserve the expanded state of the child group rows.

Remarks

Call the server-side ExpandRow(Int32, Boolean) or CollapseRow(Int32, Boolean) method to expand or collapse the specified group row.

To expand or collapse all group rows in the grid on the server side, call the ExpandAll() or CollapseAll() method.

<dx:ASPxGridView ID="ASPxGridView1" runat="server">
    <%--...--%>
    <Settings ShowGroupPanel="true" />
</dx:ASPxButton>
// Collapses the first row and keeps the expanded state of its child group rows
ASPxGridView1.CollapseRow(0);

// Collapses the first row and keeps the expanded state of its child group rows
ASPxGridView1.CollapseRow(0, false);

// Collapses the first row and all its child group rows
ASPxGridView1.CollapseRow(0, true);
See Also