PowerShell dataGridView - Copy only one Row into an other dataGridView
- by Marcel L.
I´ve got a very short question about the "dataGridView".
I´m developing with the Microsoft PowerShell and I want to copy one Row (from $dataGridView1) to the other ($dataGridView2).
With this Code I can only Copy the Value of the last focused Cell.
I´ve tried to make this for a whole Row, but it´s only working with Cells.
Here is my Code:
**$btnListeAdd.Add_Click({
$Row = $dataGridView1.Rows[ $dataGridView1.CurrentCell.RowIndex ]
$dataGridView2.Rows.Add( $dataGridView1.CurrentCell.Value )
$dataGridView1.Rows.Remove( $Row ) })
$tabListe.Controls.Add($btnListeAdd)**
Only the market Cell in $dataGridView1 (similar Column 1 or 2) will be cloned in Column1 in $dataGridView2 - in a extra Row, yey.
Thanks for helping me.
Please show mercy. It´s my first day with the PowerShell.
Kind regards,
Marcel L.