sorry Ram, didn't see your reply
I was thinking of this (very roughly)
int prev_row = -1;
int iteration_count = -1;
int this_col = 0;
foreach(DataRow row in MyDataTable)
{
iteration_count += 1;
this_row = iteration_count / 5;
this_col = iteration_count % 5;
int this_col1 = 2*this_col;
int this_col2 = (2 * this_col) + 1;
if (this_row != prev_row)
{
prev_row = this_row;
}
}
to start with, and blending it with something like
myDataGridView.Rows.Add() ;
int RowIndex = myDataGridView.RowCount - 1;
DataGridViewRow R= myDataGridView.Rows[RowIndex];
R.Cells[0].Value = columnArray[0];
R.Cells[1].Value = columnArray[1];
...