Current cell in datagrid

NekoManu

Regular
Joined
Jul 23, 2004
Messages
75
Location
Belgium
How do I set the current cell programatically?

I tried the following code, but I still need to click on the cell before it is selected. Is there a way to make the a cell the selected cell?

Code:
this.Datagridview.CurrentCell = this.Datagridview.Rows[6].Cells[1];
 
I can not build when using that code.

I tried with: grdWord.CurrentCell = new DataGridViewCell(0, 0);
which gives the error: Cannot create an instance of the abstract class or interface 'System.Windows.Forms.DataGridViewCell'

I tried with: grdWord.CurrentCell = new DataGridViewCell[0, 0];
which gives the error: Cannot implicitly convert type 'System.Windows.Forms.DataGridViewCell[*,*]' to 'System.Windows.Forms.DataGridViewCell'
 
No no no,
NOT DataGridViewCell()
DataGridCell()

this.dataGrid1.CurrentCell = new DataGridCell(0,0);

No "View".

It is a datagrid you're trying to modify isn't it?

HTH

TamuTamu
 
My apologies then, I know nothing of this at present and as far as I can see resources on the net are somewhat limited at present. :(
 
Back
Top