简体   繁体   English

与其他DataGridView数据源一样,C#Datagridview列-完全没有行

[英]C# Datagridview Columns as other DataGridView DataSource - no rows at all

I want to populate DataGridViewwith Columnsfrom other DataGridView. 我想用其他DataGridView的Columns填充DataGridView。 In result I have all columns, but no rows at all. 结果,我有所有列,但根本没有行。

Code is simple: 代码很简单:

dataGridView1.DataSource = dgv_Search.Columns;

After that Datasource has elements. 之后,数据源具有元素。 datagridview1 have columns but now rows at all. datagridview1有列,但现在有行。

Why doesn't it work? 为什么不起作用?

The following code can be found on this same site. 在同一站点上可以找到以下代码。 It gives the possibility to copy data from one datagridview to another. 它提供了将数据从一个datagridview复制到另一个datagridview的可能性。 See the code here 在这里查看代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM