title: Maximum value in a gridview column
body: <p>I have a gridview which is databound to a sql datasource and displays data as it should but now I want to display the highest value in a column in a textbox.
  I have assigned the column to a literal called litPathwayDays. The column displays a cumulative total as an Integer and obviously the last value in the column will be the highest. This is the shell I have for the databound event and I am working with VB.net 2.0.
  I'm thinking I need a For loop to iterate over all the values in the column? Could someone fill in the gaps please. Thanks.</p>
  
  <pre><code>Protected Sub GridRootCause_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridRootCause.RowDataBound
      If e.Row.RowType = DataControlRowType.DataRow Then
          Dim lit As Literal = e.Row.FindControl("litPathwayDays") 
  
          //For Each................
  
      End If
  End Sub
  </code></pre>