This is the function to check if checkbox is true winforms DataGridView:
function Install {
param (
# OptionalParameters
)
for($i=0;$i -lt $getAppsDataGrid.RowCount;$i++){
if($getAppsDataGrid.Rows[$i].Cells[3].Value -eq $true)
{
$i
$getAppsDataGrid.Rows[$i].Cells[$i].Value
write-host "cell #$i is checked"
#uncheck it
#$datagridview1.Rows[$i].Cells['exp'].Value=$false
}
else
{
#check it
#$datagridview1.Rows[$i].Cells['exp'].Value=$true
write-host "cell #$i is not-checked"
}
}
}
This is working so far. But I want the cell value from the current row. $getAppsDataGrid.Rows[$i].Cells[1].Value is not working in this function. But outside of this function it works. Also other things dont show in here like current var $i. Everything except "cell $i is checked / not checked is" irgnored
Output:
cell #0 is checked
cell #1 is checked
cell #2 is checked
cell #3 is not-checked
cell #4 is not-checked
cell #5 is not-checked
cell #6 is not-checked
cell #7 is not-checked
cell #8 is not-checked
cell #9 is not-checked
cell #10 is not-checked
cell #11 is not-checked