aspnet-devexpress-dot-web-dot-aspxgridview-dot-isrowexpanded-x28-system-dot-int32-x29.md
Identifies whether the specified group row is expanded.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public bool IsRowExpanded(
int visibleIndex
)
Public Function IsRowExpanded(
visibleIndex As Integer
) As Boolean
| Name | Type | Description |
|---|---|---|
| visibleIndex | Int32 |
The row’s visible index.
|
| Type | Description |
|---|---|
| Boolean |
true if the group row is expanded; false if the group row is collapsed.
|
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);
}
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