GridView SelectedIndexChanged event does not fire.

Posted on 2009-02-22
Last Modified: 2012-06-27
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">
                <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";
Question by:Dovberman
    1 Comment
    LVL 8

    Accepted Solution

    Add this on your gridview


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now