Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
transfering rows between datatables
siddiq shameer
Aug 19 2016 8:22 AM
233
Reply
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??
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Generate TextBox Dynamically at Runtime in Windows Form
HTML Text Editor