Skip to main content

ASPxClientGridView.CollapseRow(visibleIndex) Method

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

Declaration

CollapseRow(
    visibleIndex: number,
    recursive?: boolean
): void

Parameters

Name Type Description
visibleIndex number

The row’s visible index.

recursive boolean

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

Remarks

Call the client-side ExpandRow(visibleIndex) or CollapseRow(visibleIndex) method to expand or collapse the specified group row.

To expand or collapse all group rows in the grid on the client-side, call the ExpandAll or CollapseAll methods.

For more information on grouping in the grid, refer to the following topic: ASPxGridView - Group Data.

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

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

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