title: Add Row Click Event to Asp.Net GridView Rows
body: <p>Is there a way to add a RowClick Event to Gridview Rows without adding a button to each one? I want to be able to click anywhere in the row and raise the SelectedIndexChanged event.</p>
  
  <p>I tried the following but I need to add pages enableEventValidation="true" and I really don't want to do that.</p>
  
  <pre><code>Private Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
      Try
          Select Case e.Row.RowType
              Case DataControlRowType.DataRow
                  e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackClientHyperlink(GridView1, "Select$" &amp; e.Row.RowIndex))
          End Select
      Catch ex As Exception
  
      End Try
  End Sub
  </code></pre>
  
  <p>The RowCommands wont work either because you have to have a button.</p>