When we press the TAB key we change the focus to the next control in the given tab order. In my case when I click on a check box (say X) then after pressing Tab button the control is going on a text field instead of going on next check box (say Y) which was previously disabled and became enabled after the tab button was pressed. I want the control to move to the Check box Y. Thanks.
I have following code but it is not running when I'm pressing Tab Button:
if (((e.KeyCode == Keys.Tab && !e.Shift) || e.KeyCode == Keys.Enter) && _resultsGrid.ActiveCell != null)
{
if (_resultsGrid.ActiveCell.IsInEditMode && (_resultsGrid.ActiveCell == lastEditableCell || e.KeyCode == Keys.Enter))
{
DateTime tempDateTime = DateTime.Today;
if (!(_resultsGrid.ActiveCell.Column.DataType.ToString() == "System.DateTime" && !System.DateTime.TryParse(_resultsGrid.ActiveCell.Text, out tempDateTime)))
{
if (_resultsGrid.ActiveCell.Text == "" && (_resultsGrid.ActiveCell.Column.DataType == typeof(System.Int16) ||
_resultsGrid.ActiveCell.Column.DataType == typeof(System.Int32) ||
_resultsGrid.ActiveCell.Column.DataType == typeof(System.Int64) ||
_resultsGrid.ActiveCell.Column.DataType == typeof(System.Decimal)))
_resultsGrid.ActiveCell.Value = 0;
else
_resultsGrid.ActiveCell.Value = _resultsGrid.ActiveCell.Text;
}
_returnKeyClickedToSaveRow = true;
FireSaveEvent();
if (!_saveFailed)
{
if (e.KeyCode == Keys.Tab)
{
_checklastkey = true;
_resultsGrid.PerformAction(UltraGridAction.CommitRow);
}
else
{
_resultsGrid.PerformAction(UltraGridAction.CommitRow);
_resultsGrid.PerformAction(UltraGridAction.DeactivateCell);
}
}
_returnKeyClickedToSaveRow = false;
this._entityDS.AcceptChanges(); //EAMNET-9811
}
}