Back to Devexpress

ASPxClientGridView.RowCollapsing Event

aspnet-js-aspxclientgridview-b2149d2a.md

latest1.9 KB
Original Source

ASPxClientGridView.RowCollapsing Event

Fires when a user collapses a group row.

Declaration

ts
RowCollapsing: ASPxClientEvent<ASPxClientGridViewRowCancelEventHandler<ASPxClientGridView>>

Event Data

The RowCollapsing event's data class is ASPxClientGridViewRowCancelEventArgs. The following properties provide information specific to this event:

PropertyDescription
cancelSpecifies whether to cancel the related action (for example, row edit, export). Inherited from ASPxClientCancelEventArgs.
visibleIndexGets the processed row’s visible index.

Remarks

ASPxGridView allows users to expand or collapse group rows. When a user clicks a group row to collapse it, the control raises the RowCollapsing event. You can use the cancel argument property to prevent users from collapsing the specified group row.

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">
    <ClientSideEvents RowCollapsing="OnRowCollapsing" />
    <%--...--%>
    <SettingsBehavior AutoExpandAllGroups="true" />
    <Settings ShowGroupPanel="true" />
</dx:ASPxGridView>
js
function OnRowCollapsing(s, e) {
    if (e.visibleIndex == 0)
        e.cancel = true;
}

See Also

ASPxClientGridView Class

ASPxClientGridView Members