I have a datagridview and I want to pass some of its value to another datagridview after selecting the values and clicking a command button. Is there any possible ways for me to do it? Thanks! God Bless. :D
paulablanca
0
Junior Poster in Training
Recommended Answers
Jump to PostHi
you need Single selection or multiple selection?
If you want to have multiple selection of rows have you provided any checkbox in Grid view column?
Jump to Posthi
suppose u have two datagrid view1. DataGridView1 (source to copy from)
2. DataGridView2 (Destination to copy)For example assume that both the datagridview have 3 columns
u have a button to perform the copy.. write the following code at copy button
Dim …
Jump to Posthere is my complete code:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.DataGridView1.Columns.Add("1", "1") Me.DataGridView1.Columns.Add("2", "1") Me.DataGridView1.Columns.Add("3", "3") Me.DataGridView2.Columns.Add("1", "1") Me.DataGridView2.Columns.Add("2", "1") Me.DataGridView2.Columns.Add("3", "3") Me.DataGridView1.Rows.Add("1", "2", "3") Me.DataGridView1.Rows.Add("4", "5", "6") Me.DataGridView1.Rows.Add("7", "8", "9") Me.DataGridView1.Rows.Add("10", "11", "12") Me.DataGridView1.Rows.Add("13", "14", "15") …
Jump to PostDoes your both datagridview have the Same number and type of Columns??????
All 16 Replies
Pgmer
50
Master Poster
Featured Poster
sandeepparekh9
109
Posting Whiz
paulablanca
0
Junior Poster in Training
paulablanca
0
Junior Poster in Training
sandeepparekh9
109
Posting Whiz
hueikar
commented:
its work!
+2
paulablanca
0
Junior Poster in Training
sandeepparekh9
109
Posting Whiz
paulablanca
0
Junior Poster in Training
sandeepparekh9
109
Posting Whiz
Pgmer
50
Master Poster
Featured Poster
paulablanca
0
Junior Poster in Training
sandeepparekh9
109
Posting Whiz
paulablanca
0
Junior Poster in Training
greizz08
0
Newbie Poster
greizz08
0
Newbie Poster
arun1123
0
Newbie Poster
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.