views:

30

answers:

1

I am able to write to my unbound datagridview (VC++), but am unable to read back that same exact value. So I can do this:

myDataGridView[0,0]->Value = 1 ;

And this updates my display correctly.

But I can't do this:

printf("value=%d\n", myDataGridView[0,0]->Value ;

It compiles, but regardless of which cell I read, and regardless if I have ever written to it or not, I always read the same value (8?).

Any idea what I'm doing wrong?

Thanks! Dan

A: 

Your question is not very clear when you write "regardless of which cell I read, and regardless if I have ever written to it or not, I always read the same value." Have you tried this? C# example:

dataGridView1.Rows[0].Cells[0].FormattedValue.ToString()
0A0D