Back to Devexpress

ASPxClientGridView.CollapseAll Method

aspnet-js-aspxclientgridview-55553e81.md

latest1.7 KB
Original Source

ASPxClientGridView.CollapseAll Method

Collapses all group rows.

Declaration

ts
CollapseAll(): void

Remarks

Call the client-side ExpandAll or CollapseAll method to expand or collapse all group rows in the grid.

To expand or collapse a particular group row on the client side, call the ExpandRow or CollapseRow method.

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

Run Demo: ASPxGridView - Group Data

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="grid">
    <%--...--%>
    <Settings ShowGroupPanel="true" />
</dx:ASPxGridView>


<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Expand All" AutoPostBack="false">
    <ClientSideEvents Click="ExpandRows" />
</dx:ASPxButton>
<dx:ASPxButton ID="ASPxButton2" runat="server" Text="Collapse All" AutoPostBack="false">
    <ClientSideEvents Click="CollapseRows" />
</dx:ASPxButton>
js
function ExpandRows(s, e) {
    grid.ExpandAll();
}

function CollapseRows(s, e) {
    grid.CollapseAll();
}

See Also

ASPxClientGridView Class

ASPxClientGridView Members