Back to Devexpress

ASPxGridView.IsGroupRow(Int32) Method

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

latest2.5 KB
Original Source

ASPxGridView.IsGroupRow(Int32) Method

Indicates whether the specified row is a group row.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Parameters

NameTypeDescription
visibleIndexInt32

The row’s visible index.

|

Returns

TypeDescription
Boolean

true if the specified row is a group row; otherwise, false.

|

Remarks

Call the IsGroupRow method to get information about the grouping state of the specified row.

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

The code sample below traverses through the visible rows on page and calls the IsGroupRow method to get a collection of group row indices.

aspx
<dx:ASPxGridView ID="grid" runat="server" OnBeforeGetCallbackResult="grid_BeforeGetCallbackResult">
    <%--...--%>
    <Settings ShowGroupPanel="True" />
</dx:ASPxGridView>
csharp
protected void grid_BeforeGetCallbackResult(object sender, EventArgs e) {
    List<int> groupIndices = new List<int>();
    for(int i = 0; i < grid.VisibleRowCount; i++) {
        if(grid.IsGroupRow(i))
            groupIndices.Add(i);
    }
}
vb
Protected Sub grid_BeforeGetCallbackResult(ByVal sender As Object, ByVal e As EventArgs)
    Dim groupIndices As List(Of Integer) = New List(Of Integer)()

    For i As Integer = 0 To grid.VisibleRowCount - 1
        If grid.IsGroupRow(i) Then groupIndices.Add(i)
    Next
End Sub

See Also

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace