title: ASP.NET Gridview use 'onRowClick' to display record's Details (instead of Details/Select Button)
body: <p>Ok so I have a gridView</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
       RowStyle-CssClass="td" HeaderStyle-CssClass="th"
      CellPadding="6" DataKeyNames="ID" ShowFooter="true"&gt;
  
       &lt;Columns&gt;
          &lt;asp:BoundField DataField="Name" HeaderText="Name" /&gt;
          &lt;asp:BoundField DataField="Date" HeaderText="Date" /&gt;
          ......
           &lt;asp:TemplateField&gt;
             &lt;ItemTemplate&gt;
               &lt;asp:Button ID="lnkDetails" runat="server" Text="Details" OnClick="DetailsView" CommandName="DetailsCommand"&gt;&lt;/asp:Button&gt;
             &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
       &lt;/Columns&gt;
  </code></pre>
  
  <p></p>
  
  <p>As you can see I have configured the "lnkDetails" button so that on click fires off the DetailsView() function which 
  then calls an "SqlCommand" and binds the data to an "asp Repeater" essentially displaying a custom "Details View" of the selected record.</p>
  
  <pre><code> Protected Sub DetailsView(ByVal sender As Object, ByVal e As EventArgs)
  
          Dim con As New SqlConnection
          Dim cmd As New SqlCommand
  
          con.ConnectionString = ConnectionString() 'Thats a function
          con.Open()
          cmd.Connection = con
          cmd.CommandText = "SELECT FROM... WHERE ID=" &amp; id &amp; ""
  
          ....
  
          Repeater1.DataSource = cmd.ExecuteReader()
          Repeater1.DataBind()
   End Sub
  </code></pre>
  
  <p>Fairly straight forward Right?</p>
  
  <p>Now all I want to do (UI -wise) is allow users to fire that click event by selecting the record's (entire) row instead of the details button.
   Which I then want to hide.</p>
  
  <p>I am pretty sure you can do that either from the .aspx page with jquery (onRowClick go &amp; click the details button) or from code behind, I just haven't found a solution that works for me yet.
   Any thoughts?</p>