Skip to main content

GridControl.AllowRestoreSelectionAndFocusedRow Property

Gets or sets whether to preserve the focused row and selection after sorting, grouping or filtering in Server and Instant Feedback modes.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

[Browsable(true)]
[DefaultValue(DefaultBoolean.Default)]
[DXCategory("Data")]
public DefaultBoolean AllowRestoreSelectionAndFocusedRow { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

A DefaultBoolean enumeration value that specifies whether the focused row and selection are restored after sorting, grouping or filtering in Server and Instant Feedback modes.

Available values:

Name Description Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

Remarks

In Server and Instant Feedback modes, the View does not restore the focused row after sorting or filtering. This avoids additional requests to the server and significantly improves application performance. However, if you need to preserve the focused row, set the AllowRestoreSelectionAndFocusedRow property to true.

When grouping by a column so that this column becomes the first grouping column (or the single grouping column), the focused row is not restored (regardless of the AllowRestoreSelectionAndFocusedRow option). The view moves the row focus to the first visible data row. The same applies when you ungroup the view (there are no grouped columns).

When a selected row becomes hidden (e.g., as a result of a data filtering operation), this row is deselected, and its selection status will not be automatically restored.

See Also