On Jul 18, 5:59*am, Claudia Fong <cdolphi...@yahoo.co.ukwrote:
Hi
I have a datagrid with 12 columns and various rows...
what I want to do is to get the value of each cell, e.g. column3 row1,
column4 row1, etc..
I was using dataGridView1.Rows[dataGridView1.RowIndex].Cells but I got
an error of System.Windows.Forms.DataGridView' does not contain a
definition for 'RowIndex' * * *
Can someone tell me how can I get the value?
Cheers!
* * Claudi
*** Sent via Developersdexhttp://www.developersdex.com***
RowIndex is a property of the Cell, not of the grid.
You can use DataGridView.Rows to get the collection of the rows, then
use the Cells property of each row:
DataGridView1.Rows[ X ].Cells[ Y ]
returns the column Y of the row X