Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Collapse]Grid View
    Overview - GridView
    Main Features - GridView
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Collapse]Focus and Navigation
      Focused Row
      Selection
     [Expand]Paging and Scrolling
      Keyboard Navigation
    [Expand]Data Editing and Validation
    [Expand]Export Overview
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Focused Row

The ASP.NET MVC GridView extension provides the Focused Row feature. This feature is disabled by default. To enable it, set the ASPxGridViewBehaviorSettings.AllowFocusedRow (via GridViewSettings.SettingsBehavior.AllowFocusedRow) option to true.

The style settings used to paint the focused data row can be accessed and customized using the GridViewStyles.FocusedRow (via GridViewSettings.Styles.FocusedRow) property. The focused group row's appearance can be customized using the GridViewStyles.FocusedGroupRow (via GridViewSettings.Styles.FocusedGroupRow) property.

Expanded Moving Focus on the Server Side

On the server side, you can identify a focused row using the ASPxGridView.FocusedRowIndex (via MVCxGridView.FocusedRowIndex) property. You can use this property to move row focus within the entire grid. Note that the grid will automatically open the required page and focus the required row.

View code:

Expanded Moving Focus on the Client Side

End-users can move row focus by clicking rows. To identify the currently focused row, use the ASPxClientGridView.GetFocusedRowIndex (via MVCxClientGridView.GetFocusedRowIndex) client method. To change row focus, use the ASPxClientGridView.SetFocusedRowIndex (via MVCxClientGridView.SetFocusedRowIndex) client method.

To respond to row focus changes, handle the ASPxClientGridView.FocusedRowChanged (via MVCxClientGridView.FocusedRowChanged) client event.

Note

You can only focus a row that is currently visible on screen. If you wish to focus rows that are not visible (using a client API), you should enable row focus processing on the server side. To do this, handle the ASPxClientGridView.FocusedRowChanged (via MVCxClientGridView.FocusedRowChanged) client event and set the ASPxClientProcessingModeEventArgs.processOnServer property value to true, as shown in the example below.

In this case, the GridView extension will automatically open the required page and focus the required row.

Example

The example below demonstrates how to focus rows on the client side using the client-side API.

View code:

Partial View code:

Expanded See Also

Online demo: GridView - Focused Row
How would you rate this topic?​​​​​​​