please assign OnRowCommand
1.OnRowCommand="gvProductReceive_RowCommand"
<asp:GridView ID="gvProductReceive" Width="100%" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" GridLines="None" AllowSorting="True"
ForeColor="#333333" PageSize="30" OnPageIndexChanging="gvProductReceive_PageIndexChanging"
OnRowCommand="gvProductReceive_RowCommand" OnRowDataBound="gvProductReceive_RowDataBound">
<RowStyle BackColor="#E3EAEB" />
2.
<asp:ImageButton ID="ImgDelete" runat="server" CausesValidation="False" CommandName="CmdDelete"
CommandArgument='<%# bind("ReceivedId") %>' ImageUrl="~/Images/delete.png" Text=""
AlternateText="Delete" ToolTip="Delete" />
</ItemTemplate>
3. Catch the event on .cs file
protected void gvProductReceive_RowCommand(object sender, GridViewCommandEventArgs e)
{
int _ownerDetailId;
arrayDelete = new ArrayList();
if (e.CommandName == "CmdDelete")
{
_ownerDetailId = Convert.ToInt32(e.CommandArgument.ToString());
}
}
hopefully it works
Best regards