Hello,
you should loop your data to create the columns and rows
check this example, hope it will help :
to create the data grid columns :
int counter = 10;
int kk = 100 / 10;
for (int k = 0; k < kk; k++)
{
dataGridView1.Columns.Add(k.ToString(),k.ToString());
}
Or
int counter = 10;
for (int k = 0; k <= 100; k++)
{
if (k == counter)
{
counter += 10;
dataGridView1.Columns.Add(k.ToString(), k.ToString());
}
}
Fill empty rows :
for(int i =0;i<10;i++)
dataGridView1.Rows.Add();
Add the data :
for (int i = 0; i < 100; i++)
{
dataGridView1.Rows[ct].Cells[counter].Value = i;
ct++;
if (ct == 10)
{
ct = 0;
counter++;
}
}