Re: Datagridview Selection
Posted: Mon Apr 20, 2020 7:51 am
That is because you didn't want the adjacent cell you wanted a specific cell.
Just change one value in my code and extract the value.
Also adjacent means either current column index + 1 or current column index -1
Posting pictures of code made it hard for me to read teh error and your code. THe issue is fixed here:
Just change one value in my code and extract the value.
Code: Select all
$cell = $datagridview1.SelectedCells[0]
$Database = $datagridview1.Row[$cell.RowIndex].Cell[$cell.ColumnIndex + 1].Value
Posting pictures of code made it hard for me to read teh error and your code. THe issue is fixed here: