[C#] 纯文本查看 复制代码 DataTable dt = new DataTable();
foreach (GridColumn column in gridView1.VisibleColumns)
{
dt.Columns.Add(column.FieldName, column.ColumnType);
}
for (int i = 0; i < gridView1.DataRowCount; i++)
{
DataRow row = dt.NewRow();
foreach (GridColumn column in gridView1.VisibleColumns)
{
row[column.FieldName] = gridView1.GetRowCellValue(i, column);
}
dt.Rows.Add(row);
}
还是GOOGLE好,就点了一下就找到了 GridView To DataTable |