In my application i am trying to get datagridview (5rows and 5columns)data to a 2d array,can anybody help to get data in to array...
int countColumn = dataGridView1.ColumnCount -1;
int j=0,k=0;
string dataFromGrid = "";
foreach (DataGridViewRow i in dataGridView1.Rows)
{
if (!i.IsNewRow)
{
//dataFromGrid = r.Cells[0].Value.ToString();
for ( j = 0; j <= countColumn; j++)
{
dataFromGrid = dataFromGrid + i.Cells[j].Value.ToString();
}
}
var[k,j], Convert.ToInt32(dataFromGrid)
k=k+1;
j < countColumn