Current filter:
                                You should refresh the page.
                                Support Center
                                  • How to force the grid to focus the next row when I press the Tab or Enter key, while then last column cell is focused?

                                1 Solution

                                Creation Date Rating Importance Sort by

                                XtraGrid 2 and 3 provide an option to support this behavior: the AutoMoveRowFocus option of the GridView.OptionsNavigation property. The option is activated by default.

                                In XtraGrid 1 this can be implemented using the ProcessGridKey event of your grid control. Simply check which keys have been pressed via the e parameter passed to the event. Use the sender parameter to obtain your GridControl object, its KeyboardFocusView property to access the view which receives keystrokes and the view’s FocusedColumn and FocusedRowHandle properties to determine which cell is currently focused.

                                private void gridControl_ProcessGridKey(object sender, System.Windows.Forms.KeyEventArgs e){ DevExpress.XtraGrid.GridControl gc = (DevExpress.XtraGrid.GridControl)sender; DevExpress.XtraGrid.Views.Grid.GridView gv = (DevExpress.XtraGrid.Views.Grid.GridView)gc.KeyboardFocusView; if(!e.Shift && (e.KeyCode == System.Windows.Forms.Keys.Tab) && (gv.FocusedColumn == gv.GetVisibleColumn(gv.VisibleColumnCount -1))){ gv.FocusedColumn = gv.GetVisibleColumn(0); if (gv.FocusedRowHandle != gv.RowCount - 1) gv.FocusedRowHandle += 1; gv.ShowEditor(); e.Handled = true; } if(e.Shift && (e.KeyCode == System.Windows.Forms.Keys.Tab) && (gv.FocusedColumn == gv.GetVisibleColumn(0))){ gv.FocusedColumn = gv.GetVisibleColumn(gv.VisibleColumnCount -1); if (gv.FocusedRowHandle != 0) gv.FocusedRowHandle -= 1; gv.ShowEditor(); e.Handled = true; } }

                                See Also:
                                How to move focus to the next control when the Tab key is pressed and the last grid cell is focused

                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners