Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
How to code only one cell to one cell moving when I use keyboard
posted

     I want to move the right cell using right key in a row, but it move to next row  in my UltraGrid.  It can be move to the right cell if I use mouse click on one cell first.Can always move to adjacent cell one by one  using  up, down, left,right keyboard ? How to code?

my code,

 else if (this.ActiveControl is UltraGrid || this.ActiveControl.Parent is UltraGrid)
            {
                if (keyData == Keys.Enter)
                {
                    keyData = Keys.Tab;
                }
                else if (keyData == Keys.F5)
                {
                    if (ActiveControl is UltraGrid)
                    {
                        CurrentCtrl = this.ActiveControl;
                    }
                    else
                    {
                        CurrentCtrl = this.ActiveControl.Parent;
                    }
                    CurrentGroupBox = CurrentCtrl.Parent;
                    int GroupBoxIndex = CurrentGroupBox.TabIndex;
                    CurrentPage = CurrentGroupBox.Parent;
                    foreach (Control ctrl in CurrentPage.Controls)
                    {
                        if (ctrl is UltraGroupBox && ctrl.TabIndex != GroupBoxIndex)
                        {
                            Control childCtrl = ctrl.GetNextControl(ctrl, true);
                            if (childCtrl.CanFocus)
                            {
                                childCtrl.Focus();

// Here get focus, but move no right, How to code ?
                            }
                        }
                    }
                }

Parents
No Data
Reply
  • 69832
    Offline posted

    When a row is active but no cell is, the right and down arrow keys both move to the next row. If you assign one of the cells in the ActiveRow to the control's ActiveCell property, the right arrow key will then act on the cell rather than the row, and navigate to the next cell.

Children