got datagridview with 3 data, I want to get the first cells data on each rows, when I use this kind of code
string[] DataGridViewArray = { };
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
DataGridViewArray[i] = DataGridView1.Rows[i].Cells[0].Value.ToString().Trim();
}
textBox1.Text = DataGridViewArray.ToString();
why it keep said 'Index was outside the bounds of the array.'