I have 2 datagridviews. I need to transfer a single selected row from one to another
I have used this code:-
- private void button4_Click(object sender, EventArgs e)
- {
- List<Object> TList = new List<object>();
- foreach(DataGridViewRow row in dataGridView1.SelectedRows)
- {
- TList.Add(row.DataBoundItem);
- dataGridView2.DataSource = TList;
- }
- }
it copies a single row from datagridview1 to datagridview2 .
but when i try to add another row , it replaces the current row in datagridview2.
any solution??