Powershell Studio v5.6.170.0
- Specify if you are running a 32 or 64 bit version
64 bit
- Your operating system and if it is 32 or 64 bit.
64 bit
When adding a CellValueChanged event to a DataGridView, I receive an error in the Output window which looks like this:
Code: Select all
: Exception setting "HeaderText": "Cannot index into a null array."
*** PowerShell Script finished. ***
>> Execution time: 00:00:02
>> Script Ended
Code: Select all
$gridTicketGeneralDIS_CellValueChanged=[System.Windows.Forms.DataGridViewCellEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.DataGridViewCellEventArgs]
if ($_.ColumnIndex -eq 0) {
if ($gridTicketGeneralDIS.Rows[$_.RowIndex].Cells[0].Style.BackColor -eq 'MistyRose') {
$gridTicketGeneralDIS.Rows[$_.RowIndex].Cells[0].Style.BackColor = 'White'
} else {
$gridTicketGeneralDIS.Rows[$_.RowIndex].Cells[0].Style.BackColor = 'MistyRose'
}
}
}