Back to Devexpress

ASPxClientGridView.CollapseRow(visibleIndex) Method

aspnet-js-aspxclientgridview-dot-collapserow-x28-visibleindex-x29.md

latest1.8 KB
Original Source

ASPxClientGridView.CollapseRow(visibleIndex) Method

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

Declaration

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

Parameters

NameTypeDescription
visibleIndexnumber

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.

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="grid">
    <%--...--%>
    <Settings ShowGroupPanel="true" />
</dx:ASPxGridView>
js
// 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

ASPxClientGridView Class

ASPxClientGridView Members