I want to problematically insert data to specific positions in the data grid view...
I have 2 arrays which will be inserted in a for each loop.

Like this(this not real code):

for each..
insert to column1 in row i the value=arrayOne;
insert to column2 in row i the value=arrayTwo;
i++;
end for each

_______________________
|Col1 |Col2 |
-----------------------
|arrayOne |arrayTwo|
|arrayOne |arrayTwo|
|arrayOne |arrayTwo|
|arrayOne |arrayTwo|
========================

THANKS IN ADVANCE.

Take an advantage of DataTable.

DataTable dt = new DataTable();
dt.Columns.Add("Col1");
dt.Columns.Add("Col2");

for (int i = 0; i < arrayOne.Length && i < arrayTwo.Length; i++)
 {
   dt.Rows.Add(arrayOne[i], arrayTwo[i]);
 }
dataGridView1.DataSource = dt;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.