PowerShell Code
Double-click the code block to select all.$datagridview1.Rows | select -expand DataBoundItem | Format-Table -Auto | Out-String | Out-File printfile.txt
$datagridview1.Rows | select -expand DataBoundItem | Format-Table -Auto | Out-String | Out-File printfile.txt