title: ASP.NET - Use Column Name Instead of Index In GridViewRowEventArgs Row.Cells.Item
body: <p>I want to perform some simple auto-formatting to the cells in my GridView.  So far, I have the following code:</p>
  
  <pre><code>Private Sub gridviewRefreshPanel_RowDataBound( _
      ByVal sender As Object, _
      ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
          Handles gridviewRefreshPanel.RowDataBound
  
      Dim readyStatus As String = DataBinder.Eval(e.Row.DataItem, "READY")
  
      Select Case readyStatus
          Case "NO"
              e.Row.Cells.Item(5).ForeColor = Drawing.Color.Red
              e.Row.Cells.Item(5).Font.Bold = True
          Case "N/A"
              e.Row.Cells.Item(5).ForeColor = Drawing.Color.Goldenrod
              e.Row.Cells.Item(5).Font.Bold = True
          Case "YES"
              e.Row.Cells.Item(5).ForeColor = Drawing.Color.DarkGreen
              e.Row.Cells.Item(5).Font.Bold = True
      End Select
  
  End Sub
  </code></pre>
  
  <p>I'd like to refer to the cells by the column name rather than the index.  For example, DataRow:</p>
  
  <pre><code>row.Item("ON_TIME")
  </code></pre>
  
  <p>How do I achieve this with a GridView?</p>