Skip to main content
Tab

ASPxGridView.GetRowLevel(Int32) Method

Returns the level at which the specified row resides.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

NuGet Package: DevExpress.Web

#Declaration

public int GetRowLevel(
    int visibleIndex
)

#Parameters

Name Type Description
visibleIndex Int32

An integer value that specifies the row’s visible index.

#Returns

Type Description
Int32

An integer value that specifies the level at which the specified row resides.

#Remarks

Use the GetRowLevel method to identify at which level a group or data row resides.

GetRowLevel

#Example

protected void ASPxGridView1_SummaryDisplayText(object sender, ASPxGridViewSummaryDisplayTextEventArgs e) {
    if (e.IsGroupSummary) {
        int level = ASPxGridView1.GetRowLevel(e.VisibleIndex);
        switch (level) {
            case 0:
                e.Text = String.Format("<span style='color:red'>{0}</span>", e.Value);
                break;
            case 1:
                e.Text = String.Format("<span style='color:green'>{0}</span>", e.Value);
                break;
            case 2:
                e.Text = String.Format("<span style='color:blue'>{0}</span>", e.Value);
                break;
            default:
                break;
        }
    }
}
See Also