You will need the RowCreated event in the GridView to do so. See the sample below:
protected void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textDecoration='underline';";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
e.Row.ToolTip = "Click to select row";
e.Row.Attributes["onclick"] = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex);
}
}
You can see this link for more on selecting rows without select button - How to implement full row selecting in GridView without select button?
To prevent the PostBack, I would recommend to use UpdatePanel that I commented earlier and then deleted. Here is a sample to put the GridView inside UpdatePanel:
<asp:ScriptManager ID=" ScriptManager1" runat="server"/>
<asp:UpdatePanel ID=" UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
It's a bit of code. So I am sharing a link in the comment section. Please check.