My code is here private void copyToolStripMenuItem_Click(object sender, EventArgs e) { DataObject obj = dataGridView1.GetClipboardContent(); str = obj.GetText(TextDataFormat.CommaSeparatedValue).Substring(1).Split(','); } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { try { DataGridViewRow dgvRow = dataGridView1.Rows[0]; for (int i = 0; i < str.GetLength(0); i++) dgvRow.Cells[i].Value = str[i]; dataGridView1.Rows.Add(dgvRow); } catch (Exception ex) { } } But it throws an exception "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound" I am very confused. Kindly help me. Thanks
It seem to be a solution or an answer.