Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As suggested in one of the SO questions<br/> <a href="https://stackoverflow.com/questions/9166568/gridview-onselectedindexchanged-event-not-firing">GridView OnSelectedIndexChanged event not firing</a><br/> <a href="https://stackoverflow.com/questions/5513185/gridview-selectedindex-changed-not-firing-on-first-click">Gridview selectedindex changed not firing on first click</a> <br/><a href="https://stackoverflow.com/questions/14149383/gridview-selectedindexchanged-event-is-not-firing-i-am-using-asp-net-4-0-by-the">gridview SelectedIndexChanged Event is not firing.I am using asp.net 4.0 .By the way rowdatabound event is firing perfectly</a></p> <p>If you are just clicking on the row in the <code>GridView</code>, that will not fire the event. You have to have some kind of button in the row to click on, which will fire the <code>RowCommand</code> event, as well as the <code>SelectedIndexChanged</code> event (if the row you click is not already selected, of course). It's not exactly like the Windows Forms DataGridView =)</p> <p>The easiest way to get the event to fire, is to add this attribute to your <code>GridView</code> markup:</p> <pre><code>AutoGenerateSelectButton="True" </code></pre> <p>This creates a "Select" <code>LinkButton</code>, which will fire the <code>Gridview1_SelectedIndexChanged2</code> event in your code-behind when you click it.</p> <p><strong>EDIT:</strong> Just to clarify, this is where you need to add that attribute:</p> <pre><code>&lt;asp:GridView ID="GridView1" runat="server" GridLines="None" Width="930px" CellPadding="4" ForeColor="#333333" onselectedindexchanged="GridView1_SelectedIndexChanged2" AutoGenerateSelectButton="True" &gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload