5

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)

Erik Philips
  • 53,428
  • 11
  • 128
  • 150

1 Answers1

2

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);
    }

}
Steve
  • 213,761
  • 22
  • 232
  • 286