How to Copy Contents in one DataGridview to another DataGridview

前端 未结 3 1060
有刺的猬
有刺的猬 2021-01-16 07:00

I want to copy from one datagridview to another datagridview.

I tried the code below but I still have all data in the first columns :

For c = 0 To Re         


        
3条回答
  •  孤城傲影
    2021-01-16 07:04

    As much as I remember you just need to put this in your code

    For Each row As DataGridViewRow In classDataGridView.SelectedRows
            Dim text As String
            For Each cell As DataGridViewCell In classDataGridView.SelectedCells
                text = cell.Value.ToString
                For Each scheduleCell As DataGridViewCell In scheduleDataGridView.SelectedCells
                    scheduleCell.Value.ToString.Equals(text)
                Next scheduleCell
            Next cell
        Next
    

提交回复
热议问题