Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

 

this.Datagridview.CurrentCell = this.Datagridview.Rows[6].Cells[1];

Posted

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'

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...