title: GridView_RowDataBound (If e.Row.RowType = DataControlRowType.DataRow)....include 2 IF's?
body: <p>I've got a grid view which uses a "If e.Row.RowType = DataControlRowType.DataRow" to calculate the total of a column and hold this in the footer.</p>
  
  <pre><code>  Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
  
    If e.Row.RowType = DataControlRowType.DataRow Then
       Totalnumbers += Convert.ToInt16(DataBinder.Eval(e.Row.DataItem, "RequestTotalnumbers"))
    ElseIf 
      e.Row.RowType = DataControlRowType.Footer Then      
     e.Row.Cells(3).Text = String.Format("{0}", Totalnumbers)
      End If
  </code></pre>
  
  <p>However i now wish to also add....</p>
  
  <pre><code>    If e.Row.RowType = DataControlRowType.DataRow Then
          Dim datakey As String = GridView1.DataKeys(e.Row.RowIndex).Value.ToString()
  
      End If
  </code></pre>
  
  <p>so that it can transfer on click to another page....</p>
  
  <pre><code>    'Handle button click
      Protected Sub RowClick(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) _
      Handles GridView1.RowCommand
  
      If e.CommandName = "Select" Then
          'Add to session variable; translate the index of clicked to Primary Key
          Session.Add("ID", GridView1.DataKeys(e.CommandArgument).Value.ToString)
          Response.Redirect(" ")
      End If
  End Sub 
  </code></pre>
  
  <p>I've tried combining to two if's together but have had no success...how can i do this? </p>