0

I'm simply trying to remove a row of DataGridView by taking the first cell's value on each row,

  • I have a list, called "bags";
  • I have a delete method for the list
  • I have the string barcode;

enter image description here

the Error I get is: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'

enter image description here

  • Are you sure the grids `SelectedRows` collection actually has any rows? It will NOT be used/filled if the grids `SelectionMode` is not set to `FullRowSelect`. – JohnG Apr 23 '22 at 07:44
  • Does this answer your question? [What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?](https://stackoverflow.com/questions/20940979/what-is-an-indexoutofrangeexception-argumentoutofrangeexception-and-how-do-i-f) – JohnG Apr 23 '22 at 08:22

0 Answers0