Copy DataGridView's rows into another DataGridView

前端 未结 4 1245
[愿得一人]
[愿得一人] 2020-12-19 06:20

So basically I\'ve got 2 DataGridView and I need to copy the rows from one to the other.

So far I\'ve tried:

DataGridViewRowCollection t         


        
4条回答
  •  太阳男子
    2020-12-19 07:01

    I would recommend using a backing DTO for this. Instead of dealing with the rows directly, create a DTO that contains all the columns of your GridViews, then use a List of them as your DataSource. Then, all you have to do to add/remove rows is to add/remove DTOs in the list.

提交回复
热议问题