ASP GridView with Hover Menu, determining row that calls popup
===

So i have a gridview bound to an object datasource and a hover menu extender over that. on the panel that pops up I have a two buttons, one for delete and one for edit. the problem i'm having is identifying which row triggered the hover menu so I know what to delete. I've searched all over the site and found similar issues but I wasn't able to apply them properly. I followed this video, http://www.youtube.com/watch?v=5K4qgW2Qlhg, and was able to get a hidden field to maintain the ID but only of the last row that was created, so my delete button always removed the last entry. I hope that was somewhat clear..

Here is my gridview code: 

                    <asp:GridView runat="server" AutoGenerateColumns="False" 
                    DataSourceID="source_Layout_view" ID="GridView1" 
                    onrowdatabound="GridView1_RowDataBound" 
                    onrowcreated="GridView1_RowCreated">
                    <Columns>
                        <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" />
                        <asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
                        <asp:BoundField DataField="description" HeaderText="description" 
                            SortExpression="description" />
                        <asp:BoundField DataField="position" HeaderText="position" 
                            SortExpression="position" />
                        <asp:BoundField DataField="sequence" HeaderText="sequence" 
                            SortExpression="sequence" />
                        <asp:TemplateField>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("ID") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="img_edit" runat="server" ImageUrl='~/ui/images/wrench.png' Width="25px" Height="25px" />
                                <asp:HoverMenuExtender ID="gridview_options_extender" runat="server" PopupControlID="gridview_options_popup" TargetControlID="img_edit" 
                                 OffsetX="10" OffsetY="10" PopupPosition="Right" PopDelay="50" HoverDelay="50" >
                                </asp:HoverMenuExtender>
                                <asp:Panel ID="gridview_options_popup" runat="server">
                                    <asp:Button ID="btn_popup_delete" runat="server" Text="Delete Unit" OnClick="deleteRow"/>
                                    <br />
                                    <asp:Button ID="btn_popup_edit" runat="server" Text="Edit Unit" />
                                    <asp:HiddenField ID="tellmeRow" runat="server" Value='Eval("ID")'/>
                                </asp:Panel>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>

and here is my code behind
   
        protected void deleteRow(object sender, EventArgs e)
    {
        Button b = sender as Button;
        Panel x = b.Parent as Panel;
        HiddenField whatiwant = (HiddenField)x.FindControl("tellmeRow");
        int idForDeletion = Int32.Parse(whatiwant.Value);

        using (var context = new cocoEntities())
        {
            context.CoCo_Current.DeleteObject(context.CoCo_Current.Single(o => o.ID == idForDeletion));
            context.SaveChanges();
        }
        Response.Redirect("default.aspx");

    }

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HoverMenuExtender menu = (HoverMenuExtender)e.Row.FindControl("gridview_options_extender");
            e.Row.ID = e.Row.RowIndex.ToString();
            menu.TargetControlID = e.Row.ID;

        }
    }
}

