Reputation:
I want to change the focus on my grid cell.
Suppose I click on a cell[1,1] then I want to set the focus on cell[1,2].
Where cell[1,1]
means cell of (column 1) and (row 1)
Upvotes: 5
Views: 1921
Reputation: 216313
You could use the AfterCellActivate event and write this code
void grid_AfterCellActivate(object sender, EventArgs e)
{
if (grid.ActiveCell != null &&
grid.ActiveCell.Column.Index == 1 &&
grid.ActiveCell.Row.Index == 1)
{
grid.ActiveCell = grid.Rows[1].Cells[2];
// And if you want also to automatically
// put your cell in edit mode add this line
grid.PerformAction(UltraGridAction.EnterEditMode);
}
}
Upvotes: 2