I don't know if this issue has been solved in releases following the 20229 but here's a solution to the bug that can be quickly applied to the toolkit source files (also for framework 2.0.
Add to the HoverMenuExtender class in file HoverMenuExtender.cs the following property...
/// <summary>
/// The ClientID of a scrollable container whose offset
/// has to be applied to the popup element.
/// </summary>
[ExtenderControlProperty]
[DefaultValue("")]
public string ScrollableContainerClientID
{
get { return GetPropertyValue("ScrollableContainerClientID", ""); }
set { SetPropertyValue("ScrollableContainerClientID", value); }
}
...add the linked property in HoverMenuBehavior.js file...
this._scrollableContainerClientID = null;
...add the property getter/setter in the same file...
get_ScrollableContainerClientID : function() {
/// <value type="String">
/// Scrollable Container ID
/// </value>
return this._scrollableContainerClientID;
},
set_ScrollableContainerClientID : function(value) {
if (this._scrollableContainerClientID != value) {
this._scrollableContainerClientID = value;
this.raisePropertyChanged('ScrollableContainerClientID');
}
},
...and finally modify in the same file the "_getTopOffset" function
// [...] // this offset is always relative to the top edge of the hover element.
switch(this._popupPosition) {
case AjaxControlToolkit.HoverMenuPopupPosition.Top:
// if it's Top positioned, it's the height of the popup plus the offset.
delta = (-1 * this._popupElement.offsetHeight);
break;
case AjaxControlToolkit.HoverMenuPopupPosition.Bottom:
// if it's bottom positioned it's the height
// of the hover element plus the offset
delta = this.get_element().offsetHeight;
break;
}
// Check for the presence of a scrollable container.
// If there's one, we need to check its scroll status to add
// the correct amount of offset to hovermenu popup.
var scrollOffset = 0;
try{
if(this._scrollableContainerClientID)
var scrollContainer = $get(this._scrollableContainerClientID);
if(scrollContainer){
scrollOffset = scrollContainer.scrollTop;
}
}
catch(err)
{
//alert(err);
scrollOffset = 0;
}
return defaultTop - offsetTop + delta + this._offsetY + scrollOffset;
When you will use this customized Hovermenu you will be able to specify a Scrollable (overflowable) container as a div element whose scroll offset will be now correctly calculated (e.g. :)
<ajaxToolkit:HoverMenuExtender ID="HoverMenuExtender1" runat="server"
TargetControlID="actionImage" PopupControlID="PopupMenu" HoverCssClass="popupHover"
PopupPosition="Left" ScrollableContainerClientID="ctl00_ContentBody_TabContainer1_TabPanel2_divProduction">
</ajaxToolkit:HoverMenuExtender>