Those can be controlled using the properties RowHeaderVisible and ColumnHeaderVisible.
Assuming you already have a form with a Datagridview in it, you will need to do the following:
- Create a Column
- Create a Row with the Header value (and optionally a value for the first column)
- Add the Row to the DataGridView
- Set RowHeaderVisible to $true
- Set ColumnHeaderVisiable to $false (Optional)
Creating a Column
# Create Column object $NewColumn = New-Object -TypeName System.Windows.Forms.DataGridViewTextBoxColumn $NewColumn.Name = "Column1" $NewColumn.HeaderText = "Column1" # Add the Column to the Datagridview $DataGridView.Columns.Add($NewColumn)