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.
I tried the following but I need to add pages enableEventValidation="true" and I really don't want to do that.
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$" & e.Row.RowIndex))
End Select
Catch ex As Exception
End Try
End Sub
The RowCommands wont work either because you have to have a button.