Copying whole row of DGV
Posted: Wed Aug 07, 2019 11:52 am
Hello,
I'm trying to give my users the ability to copy the whole row of a DGV using a context menu
I've found this solution which works okay but, the data is not trimmed and I was wondering how would I do that
There is also this, but it only selects the specificied column in the row
I'm trying to give my users the ability to copy the whole row of a DGV using a context menu
I've found this solution which works okay but, the data is not trimmed and I was wondering how would I do that
- if ($datagridview1.GetCellCount('Selected'))
- {
- $dataObj = $datagridview1.GetClipboardContent()
- [System.Windows.Forms.clipboard]::SetDataObject($dataObj)
- }
- [System.Windows.Forms.clipboard]::SetText($datagridview1.CurrentRow.Cells[0].Value)