[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Collapse]Focus and Navigation
     Focusing Cells
     Moving Row Focus
     Traversing Rows
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Focusing Cells

Moving the cell focus in code may be useful when you need to facilitate end-user input. This enables you to move focus to the desired cells automatically, so end-users don't need to navigate themselves. This topic describes the basics of focus movement between cells.

Expanded Availability

Data cells can be focused if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.Cell.

Expanded Focusing Cells

The focused cell is a data cell with which an end-user can interact using the keyboard. For instance, an end-user can press F2 or ENTER to activate the cell's in-place editor.

The focused cell is identified by the focused row and focused column. The focused row is specified by the DataViewBase.FocusedRowHandle property. The focused column is specified by the DataControlBase.CurrentColumn property.

You can use the following methods to move cell focus within the focused row:

Method Description
DataViewBase.MoveNextCell Focuses the next cell after the focused cell.
DataViewBase.MovePrevCell Focuses the previous cell before the focused cell.

Expanded Example: How to Focus a Cell with the Specified Value

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1544.

This example shows how to identify a data cell with the specified value and focus it. To do this, click the 'Find Next' button. The search is performed starting from the currently focused row.

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