Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

Is there a simplest way to copy rows in one datagrid and paste it to another

$
0
0
It is simple in Winform. How to simply do it in WPF?


Code:

For Each DRow As DataGridViewRow In Datagrid1.SelectedRows
Dim ClnRow As DataGridViewRow = CType(DRow.Clone(), DataGridViewRow)

For i As Int32 = 0 To DRow.Cells.Count 'can decide how many cells will be copied
ClnRow.Cells(i).Value = DRow.Cells(i).Value
Next

datagird2.Rows.Add(ClnRow)
Next


Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>