Normally, the SelectedIndexChanged will only "work" when you have defined a button with CommandName="Select" - with that you can click any "Select" (on any row) and you will get that code to work.
Now, let me think ahead, you're thinking that you can click anywhere on the row and get that code to work?
IF yes, that will require more of code to wire up. Follow the code:
//in the RowCreated event do this:
protected void CustomersGridView_RowCreated(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
e.Row.Attributes.Add("onclick",ClientScript.GetPostBackEventReference(CustomersGridView,"Select$" + e.Row.RowIndex.ToString()));
and override the render (keep the code as is by itself on the codebehind):
protected override void Render(HtmlTextWriter writer)
for (int i = 0; i < CustomersGridView.Rows.Count; i++)
Page.ClientScript.RegisterForEventValidation(CustomersGridView.UniqueID, "Select$" + i);
change the name of the gridview to your gridviewid