GridControl.AllowRestoreSelectionAndFocusedRow Property
Gets or sets whether to preserve the focused row and selection after sorting, grouping or filtering.
Namespace: DevExpress.XtraGrid
Assembly: DevExpress.XtraGrid.v19.2.dll
Declaration
[DefaultValue(DefaultBoolean.Default)]
[Browsable(true)]
[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. |
Available values:
Name | Description |
---|---|
True | Corresponds to a Boolean value of true. |
False | Corresponds to a Boolean value of false. |
Default | The value is determined by the current object’s parent object setting (e.g., a control setting). |
Remarks
By default, in Large Data Sources: Server and Instant Feedback Modes, a focused row is not restored after sorting or filtering. This allows you to significantly improve application performance by avoiding additional requests to the server. However, if you need to preserve a focused row, set the AllowRestoreSelectionAndFocusedRow property to true.
If the grid doesn’t operate in server mode, a focused row and selection are automatically restored after sorting, grouping or filtering (by default). To disable this functionality, turn off the AllowRestoreSelectionAndFocusedRow option.
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. Focus is always moved to the first visible row. The same applies when completely ungrouping data (when no grouping column is left).
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.