我用下面的代碼來生成從DataGridViewvb.net負荷數據表到datagridview的
Dim t1 As New DataTable
For Each col As DataGridViewColumn In DataGridView1.Columns
t1.Columns.Add(col.HeaderText)
Next
For Each row As DataGridViewRow In DataGridView1.Rows
Dim dRow1 As DataRow = t1.NewRow
For Each cell As DataGridViewCell In row.Cells
dRow1(cell.ColumnIndex) = cell.Value
Next
Next
數據表現在的問題是如何加載此數據表到另一個datagridview的?
嗨,定義datatable並設置datagridview的數據源。 – 2012-08-11 16:00:52