I was getting this error while programming, went through some debugging, googling processes however I could not find the problem and I ask for your help!
MessageBox.Show(dataGridView1.RowCount.ToString());
MessageBox.Show(dataGridView1.ColumnCount.ToString());
MessageBox.Show(dataGridView1.SelectedRows[1].Cells[5].Value.ToString()); //This
According to my research, ArgumentOutOfRangeException is thrown when it's out of range.
From above code, rowcount was 11 and columncount was 7.
However my third line code throws the ArgumentOutOfRangeException:

But again, when I put 0 instead of 1 for SelectedRows, it works fine. The rest don't work.
I feel like I'm doing everything right. Can someone please help this beginner? Thank you for reading :)