Back to Devexpress

ASPxGridView.IsRowExpanded(Int32) Method

aspnet-devexpress-dot-web-dot-aspxgridview-dot-isrowexpanded-x28-system-dot-int32-x29.md

latest2.6 KB
Original Source

ASPxGridView.IsRowExpanded(Int32) Method

Identifies whether the specified group row is expanded.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public bool IsRowExpanded(
    int visibleIndex
)
vb
Public Function IsRowExpanded(
    visibleIndex As Integer
) As Boolean

Parameters

NameTypeDescription
visibleIndexInt32

The row’s visible index.

|

Returns

TypeDescription
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.

aspx
<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>
js
function OnClick(s, e) {
    grid.PerformCallback();
}
csharp
protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    if(ASPxGridView1.IsRowExpanded(0))
        ASPxGridView1.CollapseRow(0);
    else
        ASPxGridView1.ExpandRow(0);
}
vb
Protected Sub ASPxGridView1_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    If ASPxGridView1.IsRowExpanded(0) Then
        ASPxGridView1.CollapseRow(0)
    Else
        ASPxGridView1.ExpandRow(0)
    End If
End Sub

See Also

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace