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 ? } } } }
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.
Thank you!
I has knowed these, But I want to active first cell of current row in my code, Instead of Ctrl+space key or click, How to code do it?