Grid View selected index

Posted by user2924573 on Stack Overflow See other posts from Stack Overflow or by user2924573
Published on 2013-11-04T03:50:25Z Indexed on 2013/11/04 3:53 UTC
Read the original article Hit count: 118

Filed under:
|
|

I have a grid which contains a edit button . When i click the edit button and debug it does not hit to the selected index change event . There are no build errors

code behind the grid

public void btnModemDetailsEdit_Click(object sender, EventArgs e)
        {
            isEdit = true;
        }

        protected void gridModemDetails_SelectedIndexChanged(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(GridModemDetails.DataKeys[GridModemDetails.SelectedIndex].Values["gridModemDetails_SelectedIndexChanged"].ToString());
        }






<asp:GridView ID="GridModemDetails" runat="server" Width="435px" 
                            DataKeyNames="ModemId" AllowPaging="True"
                            OnSelectedIndexChanged="gridModemDetails_SelectedIndexChanged"
                                AutoGenerateColumns="False">
                                <Columns>
                                    <asp:TemplateField HeaderText="Edit" Visible="True" >
                                    <ItemTemplate>
                                    <asp:LinkButton  ID="btnModemDetailsEdit"  AccessibleHeaderText="Edit" ButtonType="Button" Text="Edit" HeaderText="Edit" runat="server" OnClick="btnModemDetailsEdit_Click"  runat="server"/>
 </ItemTemplate>
 </asp:TemplateField>

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET