I have a grid template column, which is an icon, and on mouseover should show the picture as a tooltip. It works fine with IE, but with FireFox, it sometimes shows the tooltip for top two rows, and for the rest it does not. The grid has paging, and when you come back to the first page, it does not show tooltips at all, for which it was showing before. Its the second column in the grid. I am attaching only that part of the code which deals with the RadToolTipManager
version : RadControls for ASP.NET AJAX Q1 2008
ASPX Code :
<
telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" RelativeTo="Element" Animation="None" OnAjaxUpdate="OnAjaxUpdate" AutoCloseDelay="2000" HideDelay="0" ShowCallout="false" Position="MiddleRight" ShowDelay="0" ContentScrolling="Auto" ShowEvent="OnMouseOver" Visible="true" Style="display: none;">
</telerik:RadToolTipManager>
<
telerik:RadGrid ID="RadGridMain" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnItemEvent="RadGridMain_ItemEvent" OnNeedDataSource="RadGridMain_NeedDataSource" OnItemDataBound="RadGridMain_ItemDataBound">
<MasterTableView>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn UniqueName="Detail">
<ItemTemplate>
<sis:WebButton ID="WebButtonDetail" runat="server" ImageUrl="~/App_Themes/LBL/wbtnDetail_small.gif" IsSmallButton="true" UseCssHover="true" AutoTipKey="Detail" OnCommand="WebButtonDetail_OnCommand" CommandArgument='<%# Eval("StudentDBN") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Photo" UniqueName="Photo">
<ItemTemplate>
<sis:WebButton ID="WebButtonCamera" runat="server" ImageUrl="~/App_Themes/LBL/wbtnCamera.gif" UseCssHover="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
C# Code :
protected
void Page_Load( object sender, EventArgs e ) {
if
( Page.IsPostBack == false ) {
this.RadToolTipManager1.TargetControls.Clear();
}
protected
void RadGridMain_ItemDataBound( object sender, GridItemEventArgs e ) {
if
( e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item ) {
WebButton
photoBtn = e.Item.Cells[3].FindControlRecursive<WebButton>();
if
(photoBtn != null){
photoBtn.Visible = btnVisible;
if (btnVisible)
{
photoBtn.ID = sum.StudentDBN +
".jpg";
this.RadToolTipManager1.TargetControls.Add(photoBtn.ClientID, true);
} } }
protected
void OnAjaxUpdate( object sender, ToolTipUpdateEventArgs args ) {
int start = args.TargetControlID.LastIndexOf( "_" );
string im = args.TargetControlID.Substring( start + 1 );
Image image = new Image();
image.ImageUrl = im;
image.ImageUrl =
"Images/GetImage.ashx?s=" + im;
if ( image.Height.Value > 200 ) {
image.Height = 200;
}
args.UpdatePanel.ContentTemplateContainer.Controls.Add( image );
int index = args.TargetControlID.LastIndexOf( "_" );
string elementID = args.TargetControlID.Substring( index + 1 );
this.UpdateToolTip( elementID, args.UpdatePanel );
}
private void UpdateToolTip( string elementID, UpdatePanel panel ) {
Control ctrl = Page.LoadControl( "Controls/StudentPhotoPopup.ascx" );
panel.ContentTemplateContainer.Controls.Add( ctrl );
//
}
Thanks,
Brenda