I am trying to get the selected row of the GridView
, and I know that I should be able to get that information based on the OnSelectedIndexChanged
event. Whenever I click on the row, the event does not fire.
<asp:GridView ID="GridView1" runat="server" GridLines="None"
Width="930px" CellPadding="4" ForeColor="#333333"
onselectedindexchanged="GridView1_SelectedIndexChanged2">
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
protected void GridView1_SelectedIndexChanged2(object sender, EventArgs e)
{
//string company = GridView1.SelectedRow.Cells[0].Text;
Response.Redirect("Client_View.aspx", false);
}
Any help with this would be appreciated. There is no code that I can see that resets its reference to another event, that I can see.
See Question&Answers more detail:os