Skip to main content

ASPxClientGridView.CollapseAllDetailRows Method

Collapses all detail rows.

Declaration

CollapseAllDetailRows(): void

Remarks

If the ASPxGridViewDetailSettings.AllowOnlyOneMasterRowExpanded option is set to false, an end-user can expand multiple detail rows simultaneously. To collapse all expanded detail rows, use the CollapseAllDetailRows method.

Individual detail rows can be collapsed via the ASPxClientGridView.CollapseDetailRow method.

To learn more, see Expanding and Collapsing Detail Rows.

Example

<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Expand All Detail Rows" AutoPostBack="False">
     <ClientSideEvents Click="function(s, e) {grid.ExpandAllDetailRows();}" />
</dx:ASPxButton>

<dx:ASPxButton ID="ASPxButton2" runat="server" Text="Collapse All Detail Rows" AutoPostBack="False">
     <ClientSideEvents Click="function(s, e) {grid.CollapseAllDetailRows();}" />
</dx:ASPxButton>

<dx:ASPxGridView ID="grid" runat="server" ClientInstanceName="grid" DataSourceID="CustomersDataSource" KeyFieldName="CustomerID" >
     <Columns>
            <dx:GridViewDataColumn FieldName="ContactName" />
            <dx:GridViewDataColumn FieldName="CompanyName" />
            <dx:GridViewDataColumn FieldName="City" />
            <dx:GridViewDataColumn FieldName="Country" />
     </Columns>
     <Templates>
            <DetailRow>
               ...
            </DetailRow>
     </Templates>
     <SettingsDetail ShowDetailRow="true" />
</dx:ASPxGridView>
See Also