Skip to main content
Tab

ASPxGridView.IsRowExpanded(Int32) Method

Identifies whether the specified group row is expanded.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public bool IsRowExpanded(
    int visibleIndex
)

Parameters

Name Type Description
visibleIndex Int32

The row’s visible index.

Returns

Type Description
Boolean

true if the group row is expanded; false if the group row is collapsed.

Remarks

Call the IsRowExpanded method to get information about the current expanded or collapsed state of the specified group row.

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

<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="grid"
    OnCustomCallback="ASPxGridView1_CustomCallback">
    <%--...--%>
    <Settings ShowGroupPanel="true" />
</dx:ASPxGridView>
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Expand/Collapse the First Row" AutoPostBack="false">
    <ClientSideEvents Click="OnClick" />
</dx:ASPxButton>
function OnClick(s, e) {
    grid.PerformCallback();
}
protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    if(ASPxGridView1.IsRowExpanded(0))
        ASPxGridView1.CollapseRow(0);
    else
        ASPxGridView1.ExpandRow(0);
}
See Also