Hi all,

ANother newb question.
Is there a way to loop through the selected rows and store them in an array?
I've been working at it and have come up with this but it isnt working correctly.

2 Code:
  1. int rCount = gridOffice.Rows.GetRowCount(DataGridViewElementStates.Selected);
  2.             if (rCount> 0)
  3.             {
  4.                 String[,]s = new String[rCount,cCount];
  5.                 for (int i = 0; i < rCount; i++)
  6.                 {
  7.                     for (int j = 0; j < 2; j++)
  8.                     {
  9.                         s[i,j] = gridOffice.Rows[gridOffice.SelectedCells[i].RowIndex].Cells[j].FormattedValue.ToString();
  10.                     }
  11.                 }

Thanks in advance