Michael,
There are more succinct ways of doing this:
dataGridView1.CurrentCellAddress = new Point(1, 1);
Or, if you wish:
dataGridView1.CurrentCell = dataGridView1[1, 1];
Both should have the same effect, although the top example will help
prevent unsharing of rows, which is good when you are using the grid in
virtual mode.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Sorry for the bandwidth, just found that I just have to point to that said
> cell, after all... doh. No need to 'create' one, as the example from
[quoted text clipped - 14 lines]
>>
>> Vanderghast, Access MVP
Michel Walsh - 15 Feb 2008 14:15 GMT
If I can ask you one more question.
While
dataGridView1.CurrentCell = dataGridView1[1, 1];
is fine for me, if I consider dataGridView[1,1] is a reference (a pointer)
to an existing cell, and then CurrentCell property just 'set the focus' on
that 'object reference' it got as its 'value', I fail to see how:
dataGridView1.CurrentCellAddress = new Point(1, 1);
could even work, since
new Point(1, 1)
is also a reference, but totally unrelated to any cell-references
(cell-pointers) owned by the dataGridView object. With this, in
consideration, can you explain the inner-working of
dataGridView1.CurrentCellAddress = new Point(1, 1);
Thanks for your time
Vanderghast, Access MVP
> Michael,
>
[quoted text clipped - 9 lines]
> prevent unsharing of rows, which is good when you are using the grid in
> virtual mode.
Nicholas Paldino [.NET/C# MVP] - 16 Feb 2008 19:06 GMT
Michel,
As you and Andrus pointed out, you the CurrentCellAddress property is
read-only, so you can't set it.
So only the first example I gave is valid.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> If I can ask you one more question.
>
[quoted text clipped - 34 lines]
>> prevent unsharing of rows, which is good when you are using the grid in
>> virtual mode.
Andrus - 15 Feb 2008 17:58 GMT
> dataGridView1.CurrentCellAddress = new Point(1, 1);
causes error
'System.Windows.Forms.DataGridView.CurrentCellAddress' cannot be assigned
to -- it is read only
So how to use it ?
Andrus.