This is a migrated thread and some comments may be shown as answers.

RadToolTipManager is not rendering to correct Positio

2 Answers 121 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Savan
Top achievements
Rank 1
Savan asked on 29 Apr 2009, 11:26 AM
Hi,

I am using RadToolTipManager in sharepoint web part with SPGridView & Ajax.
on gridView_RowDataBound, I am adding controls in RadToolTipManager 

void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    string ID = DataBinder.Eval(e.Row.DataItem, "ID").ToString();
                    Label lbl = (Label)e.Row.FindControl("lblFieldName");
                    RadToolTipManager1.TargetControls.Add(lbl.ClientID, ID, true);
                }
            }
            catch(Exception ex)
            {

            }
        }

This is my first column in Grid.
So when I hover mouse on the first column. ToolTip is appearing.
But only problem is that, When I hove mouse first time on column,
ToolTip appear on Left Bottom position relative to page and not with grid column.

But next time it will appear at correct position. i.e. On First Grid Column.
This is my code, how I added RadToolTipManager in web part

                RadToolTipManager1 = new RadToolTipManager();
                RadToolTipManager1.AjaxUpdate += new ToolTipUpdateEventHandler(RadToolTipManager1_AjaxUpdate);
                RadToolTipManager1.RelativeTo = ToolTipRelativeDisplay.Mouse;
                RadToolTipManager1.Position = ToolTipPosition.BottomRight;               
                RadToolTipManager1.HideEvent = ToolTipHideEvent.ManualClose;
                this.panel.Controls.Add(RadToolTipManager1);

Please reply,
Thanks
Savan

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 04 May 2009, 07:52 AM
Hi Savan,

I am not completely sure what might be causing the problem but I assume that one possible reason could be that you have not provided explicit size to the RadToolTipManager. If this is so, it is expected that the first time the tooltip cannot position correctly because the manager cannot predict how large the content should be and tries to resize according to it. Next time the tooltip is shown, the manager is already aware of the size of the content and that is why the tooltip is positioned correctly. This being said, please set the width and height of the RadToolTipManager explicitly and test again whether this fixes the issue. If this is not the case, please prepare a sample reproduction demo (use Northwind or a fake data source for the grid), open a new support ticket and send it to me along with detailed reproduction steps, explanations and a few screenshots and I will do my best to help.


Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bieters Bieters
Top achievements
Rank 1
answered on 31 May 2010, 02:00 PM
I recieved this via support. Maybe helpful for somebody else:

Put this on RadTooltipManager control:
Width="50px" OnClientResponseEnd="TooltipResponseRecieved"

Add this javascript code to the page:
function TooltipResponseRecieved(tooltipMngr, args) {
            var current = Telerik.Web.UI.RadToolTip.getCurrent();
            if (current) {
                var popupElement = current.get_popupElement()
                if(popupElement)
                {
                    popupElement.style.width = "";     
                }
                  
                var tableElement = current._tableElement;
                if (tableElement) {
                    tableElement.style.width = "";
                }
            }
        } 
Tags
ToolTip
Asked by
Savan
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Bieters Bieters
Top achievements
Rank 1
Share this question
or