title: VB/ASP.NET, Access GridView cell value to variable
body: <p>Here's the app:</p>
  
  <p>Have a grid view with some rows. When the user clicks edit on the web form it opens up a couple of the fields for editing. What I'm trying to do is when the RowUpdating fires, is check the value of one of the fields in the grid view and verifies its within a certain range and then cancels if its outside of that range. </p>
  
  <p>I actually have almost all of that framework done, except I can't obtain the value from the field in the GridView. </p>
  
  <p>I've searched this site up and down with a few others, and all list some solutions but none have worked. I get cannot be converted to string/integer, plus some others. </p>
  
  <p>Any suggestions? Here's my lastest:</p>
  
  <pre><code>    Private Sub gvCourses_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvCourses.RowUpdating
      Dim x As String
      x = gvCourses.SelectedRow.Cells[3].Text
      MsgBox(x) ' Just a check to see if I get the variable to display the correct value, not part of the final app
  </code></pre>
  
  <p>I've also tried different variations of the above, none of which worked. The one above I get System.Web.UI.WebControls.TableCellCollection cannot be converted to String.</p>
  
  <p>I've seen several examples but none of them work. Anyone have any suggestions? </p>
  
  <p>Thanks.</p>