[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Collapse]Vertical Grid
   [Expand]Binding to Data
   [Collapse]Data Layout: Records, Rows and Cells
    [Expand]Rows
    [Collapse]Records
      Adding and Deleting Records
      Focus and Scroll Records
    [Expand]Cells
     Customization Form
     Data Layout: Records, Rows, and Cells
   [Expand]Layouts
   [Expand]Data Editing and Validation
    Filtering
    Formatting Values
   [Expand]Drag and Drop
   [Expand]Appearance and Custom Painting
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Hit Information
    Batch Modifications
   [Expand]Member Tables
   [Expand]Examples
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Focus and Scroll Records

This topic explains how to focus and scroll records in code. For example, you can:

  • scroll the view to a record and activate an editor
  • provide a custom control that navigates through records
  • scroll to a record that satisfies the condition

To learn how users can focus and scroll records, see Navigating Through Cells.

Expanded Focus and Scroll Records in Code

Use the following vertical grid's API to focus and scroll records in code:

Whether the focus moves when the view is scrolled, depends on the current layout:

Expanded Custom Data Navigator

This example shows how to create a custom data navigator. The control comprises navigation buttons and a check box as shown below.

The table below lists the elements of this navigation panel, their names, and explains their purpose.

Element Description Name
If checked, the navigation panel's buttons move focus. Otherwise, they scroll the view horizontally. chbMoveFocus
If the check box is checked, focuses the first record. Otherwise, scrolls the view so that the first record is visible leaving the focus unchanged. btnFirst
If the check box is checked, shifts focus backwards one record. Otherwise, scrolls the view left by one record leaving the focus unchanged. btnPrev
Makes the focused record visible. btnShowFocused
If the check box is checked, shifts focus forward one record. Otherwise, scrolls the view right by one record leaving the focus unchanged. btnNext
If the check box is checked, focuses the last record. Otherwise, scrolls the view so that the last record is visible leaving the focus unchanged. btnLast

Handle the Click events as the code below shows. The vertical grid should apply the multiple records view to see the difference between when you move the focus and when you scroll the view.

Is this topic helpful?​​​​​​​