Posted on: 11/13/2013 12:53:32 PM | Views : 812

I have a gridview on my web page and I added a delete button.  When the delete button is clicked, I delete a row from my database table.  This all works at the moment.
The problem is the SelectedIndexChanged event fires whenever the delete button is clicked.  I have some javascript that allows the user to click anywhere on the row to fire the SelectedIndexChanged event.  Is there a way to not fire this event if the delete button is clicked?  Here is my code:

<asp:Gridview ID="gvOrders" runat="Server" DataKeyNames="OrderId" AutoGenerateColumns="False" AllowSorting="true" AllowPaging="True" PageSize="20" OnRowDataBound="gvOrders_RowDataBound" OnSelectedIndexChanged="gvOrders_SelectedIndexChanged" OnPageIndexChanging="gvOrders_PageIndexChanging" OnSorting="gvOrder ...

Go to the complete details ...