Back to Devexpress

GridControl.AllowRestoreSelectionAndFocusedRow Property

windowsforms-devexpress-dot-xtragrid-dot-gridcontrol-a1b642e3.md

latest3.0 KB
Original Source

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.v25.2.dll

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

Declaration

csharp
[Browsable(true)]
[DefaultValue(DefaultBoolean.Default)]
[DXCategory("Data")]
public DefaultBoolean AllowRestoreSelectionAndFocusedRow { get; set; }
vb
<DefaultValue(DefaultBoolean.Default)>
<Browsable(True)>
<DXCategory("Data")>
Public Property AllowRestoreSelectionAndFocusedRow As DefaultBoolean

Property Value

TypeDefaultDescription
DefaultBooleanDefault

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:

NameDescriptionReturn 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

GridControl Class

GridControl Members

DevExpress.XtraGrid Namespace