Setting focus to a particular cell in DataGrid

  • Thread starter Thread starter sailu
  • Start date Start date
S

sailu

Hi,

Anyone knows how can i set the focus to a particular cell in DataGrid.

Thanks,
Sailaja.
 
use the CurrentCell property:

System.Windows.Forms.DataGrid.HitTestInfo hitInfo = dg.HitTest(new
Point(e.X, e.Y));
// find out which cell is entered
dg.CurrentCell = new DataGridCell(hitInfo.Row,hitInfo.Column);
 
I tried the CurrentCell Property. I can able to point a particular
cell. But i want to set focus to that particular cell.
 
Back
Top