I have an ASP.NET DataGrid that I am trying to add a HoverMenu Extender to. The grid markup is as follows:
<asp:datagrid id="dgrExisting" runat="server" autogeneratecolumns="false" cssclass="FormattedTable" onitemcommand="dgrExisting_ItemCommand" onitemdatabound="dgrExisting_ItemDataBound">
<headerstyle cssclass="FormattedTableHeader">
<alternatingitemstyle cssclass="FormattedTableAltRow"></alternatingitemstyle>
<columns>
<asp:boundcolumn datafield="UrlId" visible="false"></asp:boundcolumn>
<asp:boundcolumn datafield="MonitorUrl" headertext="Url"></asp:boundcolumn>
<asp:boundcolumn datafield="LastChecked" headertext="Last Checked"></asp:boundcolumn>
<asp:boundcolumn datafield="NextCheck" headertext="Next Check" visible="false"></asp:boundcolumn>
<asp:boundcolumn datafield="LastLoadTime" headertext="Last Load Time<br></asp>(Milliseconds)">
<asp:boundcolumn datafield="LastStatus" headertext="Last Status"></asp:boundcolumn>
<asp:templatecolumn>
<itemtemplate>
<asp:panel id="pnlPopupMenu" runat="server">
<div style="border: 1px outset white; padding: 2px;">
<div><asp:linkbutton id="lnkReport" runat="server" commandname="Report" text="View Reports"></asp:linkbutton></div>
<div><asp:linkbutton id="lnkDelete" runat="server" commandname="Delete" text="Delete"></asp:linkbutton></div>
<asp:confirmbuttonextender id="cbeNewDelete" runat="server" targetcontrolid="lnkDelete" confirmtext="Are you sure you want to remove this URL?"></asp:confirmbuttonextender>
</div>
</asp:panel>
<asp:hovermenuextender id="hoverMenu" runat="server" popupcontrolid="pnlPopupMenu" popupposition="Right" hovercssclass="popupHover" targetcontrolid="pnlPopupMenu" popdelay="50"></asp:hovermenuextender>
</itemtemplate>
</asp:templatecolumn>
</asp:boundcolumn>
</columns>
</asp:datagrid>
In the ItemDataBound event I am setting the ID to allow it to work for the whole row, I'm using the following for that:
protected void dgrExisting_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
AjaxControlToolkit.HoverMenuExtender oHoverMenu = (AjaxControlToolkit.HoverMenuExtender)e.Item.FindControl("hoverMenu");
e.Item.ID = e.Item.ItemIndex.ToString();
oHoverMenu.TargetControlID = e.Item.ID;
}
}
As it is, the menu displays, however, clicking on the link buttons never actually posts back to the server allowing the item command to be processed. If I disable the hover menu extender, the buttons do work as expected.
What am I missing?