FocusedRowChangedEventArgs.PrevFocusedRowHandle Property

Gets the handle of the previously focused row.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.2.dll


public int PrevFocusedRowHandle { get; }
Public ReadOnly Property PrevFocusedRowHandle As Integer

Property Value

Type Description

An integer value representing the handle of the previously focused row. The GridControl.InvalidRowHandle field value if no row was previously focused.


This example expands a collapsed group row and vice versa when this row receives focus.

using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Base;

private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) {
     GridView view = sender as GridView;
     if (view == null) return;
     if (view.IsGroupRow(e.FocusedRowHandle)) {
        bool expanded = view.GetRowExpanded(e.FocusedRowHandle);
        view.SetRowExpanded(e.FocusedRowHandle, !expanded);
See Also