Please refer my answer -
Data GridView selected index changed firing Problem ASP.NET[
^].
Update
It seems that without the Select Button, the event is not going to fire. So, do like below.
- Make the
AutoGenerateSelectButton = "True"
.
And write OnSelectedIndexChanged
Event.
AutoGenerateSelectButton="True"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
- Add the below Code in
RowDataBound
Event.
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Style.Add(HtmlTextWriterStyle.Display, "none");
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Style.Add(HtmlTextWriterStyle.Display, "none");
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex);
}
Now it should work perfectly and Select button will not show.