Powershell datagridview
Jeg vil gerne tilføje en dropdown liste med choice1 og choice2 til nedenstående. Samtidig vil jeg også gerne have tilføjet en cancel knap der bare laver en exit og en Save knap der udfører noget med den aktuelle data. Kan nogen hjælpe mig, da jeg er kørt fast.Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
[System.Windows.Forms.Application]::EnableVisualStyles()
$Project = New-Object System.Windows.Forms.Form
$Project.ClientSize = New-Object System.Drawing.Point(604,460)
$Project.Text = "My DataGridView"
$Project.TopMost = $True
$Project.MinimumSize = $Project.ClientSize
$Project.FormBorderStyle = 'FixedDialog'
$Project.StartPosition = "CenterScreen"
# Create project Form Control.
$DataGridView = New-Object System.Windows.Forms.DataGridView
$DataGridView.Width = 572
$DataGridView.Height = 213
$DataGridView.ColumnHeadersVisible = $True
$DataGridView.ColumnCount = 2
$dataGridView.Columns[0].Name = "Column0"
$dataGridView.Columns[1].Name = "Column1"
$DataGridView.Location = New-Object System.Drawing.Point(16,107)
$DataGridView.SelectionMode = 'FullRowSelect'
$DataGridView.MultiSelect = $False
$DataGridView.TabIndex = 0
$DataGridView.RowHeadersVisible = $False
$DataGridView.AutoSizeColumnsMode = 'Fill'
$DataGridView.AllowUserToAddRows = $False
$DataGridView.AllowUserToDeleteRows = $True
$DataGridView.AllowUserToResizeRows = $True
$DataGridView.ReadOnly = $False
$DataGridView.AllowDrop = $True
$DataGridView.RowTemplate.Height = 17
$DataGridView.Enabled = $True
$Project.Controls.AddRange(@($DataGridView))
$DataGridView.Rows.Add('Row1Col0','Row1Col1')
$DataGridView.Rows.Add('Row2Col0','Row2Col1')
[void]$Project.ShowDialog()