DataGridView change current cell programmatically

  • Thread starter Stanislav Nedelchev
  • Start date
S

Stanislav Nedelchev

Hi there,
I have problem when i try to change current cell of DataGridView by my
program. In dot net version 1.1 i'm using DataGrid
and there is DataGrid.CurrentCell = new DataGridCell(1,1);
But i didn't find a way how to do this with DataGridView.
I just want when it's neessary to make my curent cell to last row in
data gridview and secind column.
something like GataGridView.CurrentCell = new
DataGridViewCell(unitsDataGridView.Rows.Count,2);

I;m getting this error
Error 1 Cannot create an instance of the abstract class or interface
'System.Windows.Forms.DataGridViewCell'


Can Anybody Help me to manage this.
 
B

Bart Mermuys

Hi,

Stanislav Nedelchev said:
Hi there,
I have problem when i try to change current cell of DataGridView by my
program. In dot net version 1.1 i'm using DataGrid
and there is DataGrid.CurrentCell = new DataGridCell(1,1);
But i didn't find a way how to do this with DataGridView.
I just want when it's neessary to make my curent cell to last row in
data gridview and secind column.
something like GataGridView.CurrentCell = new
DataGridViewCell(unitsDataGridView.Rows.Count,2);

Try:
SomeDataGridView.CurrentCell = SomeDataGridView[2,
SomeDataGridView.RowCount - 2 ];


HTH,
Greetings
 

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