Setting focus to a particular cell in DataGrid

S

sailu

Hi,

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

Thanks,
Sailaja.
 
K

KJ

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

sailu

I tried the CurrentCell Property. I can able to point a particular
cell. But i want to set focus to that particular cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top