title: ASP.Net Get Values ArgumentOutOfRangeException Thrown
body: <p>I'm trying to loop through a gridview and save all the items in it at once. However I have a problem getting the values from the dropdownlist and textbox. I get this error each time:</p>
  
  <pre><code>ArgumentOutOfRangeException was caught. Specified argument was out of the range of valid values.
  </code></pre>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>foreach (GridViewRow gvr in gvInvalidOrgs.Rows)
  {
     try
      {
       org_code = Convert.ToInt32(gvr.Cells[0].Text);
       division = ((DropDownList)gvr.Cells[1].Controls[0]).SelectedValue;
       org_description = (((TextBox)gvr.Cells[2].Controls[0]).Text);
      }
      ...
  }
  </code></pre>
  
  <p>Both the textbox and the dropdownlists are dynamically created on rowbound if that matters.</p>
  
  <p>TIA</p>