Skip to main content

FocusedRowChangedEventArgs.PrevFocusedRowHandle Property

Gets the handle of the previously focused row.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v23.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

public int PrevFocusedRowHandle { get; }

Property Value

Type Description
Int32

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

Example

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);
     }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PrevFocusedRowHandle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also