• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1771
  • Last Modified:

GridView SelectedIndexChanged event does not fire.

I have a gridview with the select button enabled. When I click the select button, the
SelectedIndexChanged event does not fire.

<asp:GridView ID="grdExceptions" runat="server"
            AutoPostBack="True" Height="20px"
            Width="496px" Caption="Selected Stocks"
            BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
            BackColor="Azure" AlternatingRowStyle-BackColor="#FFFF66"
            AlternatingRowStyle-BorderStyle="Solid" Font-Names="Arial"
            Font-Size="Smaller" AutoGenerateColumns="False"
            DataKeyNames="SymbolID" DataSourceID="dscExceptions"
            AllowPaging="True" PageSize="16">
           
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="SymbolID" HeaderText="SymbolID"
                    InsertVisible="False" ReadOnly="True" SortExpression="SymbolID"
                    Visible="False" />

//This line is not reached when running in Debug mode.
protected void grdExceptions_SelectedIndexChanged(object sender, EventArgs e)
        {


            string strStockSelectCon = "Data Source=localhost;Initial Catalog=StockSelectSQL;";
            strStockSelectCon += "Integrated Security=SSPI";
0
Dovberman
Asked:
Dovberman
1 Solution
 
tiagosalgadoCommented:
Add this on your gridview

OnSelectedIndexChanged="grdExceptions_SelectedIndexChanged"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now