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

Not geting Tooltip at correct postion of Items in RadLIstbox

2 Answers 100 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
ashirvad
Top achievements
Rank 1
ashirvad asked on 15 Sep 2011, 08:22 AM
Hi Telerik team,
I am using a Radlistbox and show a tooltip .The proble is i am not able to get the tooltip at correct position . Here is my RadlistBOx code.
<telerik:RadListBox ID="RadListBox2" runat="server" Width="280px" Height="280px"
         CssClass ="radcss" AutoPostBackOnTransfer="true"  AllowTransferOnDoubleClick="true"
            SelectionMode="Multiple" AutoPostBackOnReorder="true" EnableDragAndDrop="true" AutoPostBack="true"
                 Skin="Office2010Blue"     OnSelectedIndexChanged="row_click"
                 AllowDelete="True"  >
           
            <ButtonSettings ShowTransferAll="false" />
             </telerik:RadListBox>

and here is my tooltip code. Actually i am using user control as tooltip.

<telerik:RadToolTip ID="RadToolTip1" runat="server" BackColor="white"  
            ManualClose="false"   OnClientBeforeShow="OnClientBeforeShow"  Relative To ="Element"
             
              RenderInPageRoot="true" EnableShadow="true" Animation="Slide"   >
                            
                        
             <web:web ID ="tooltip" runat="server" /></telerik:RadToolTip>

and here is my c # code onSelectedIndexChanged="row_click"
public void row_click(object sender, EventArgs e)
    {
 
        tooltip.Refresh(Convert.ToInt32(((Telerik.Web.UI.ControlItem)(((Telerik.Web.UI.RadListBox)(sender)).SelectedItem)).Value));
 
        tooltip.UserName = Convert.ToString(((Telerik.Web.UI.ControlItem)(((Telerik.Web.UI.RadListBox)(sender)).SelectedItem)).Text);
        ((System.Web.UI.Control)(((Telerik.Web.UI.RadListBox)(sender)).SelectedItem)).Focus();
         
        RadToolTip1.TargetControlID = ((System.Web.UI.Control)(((Telerik.Web.UI.RadListBox)(sender)).SelectedItem)).UniqueID;
        RadToolTip1.RelativeTo =Telerik.Web.UI.ToolTipRelativeDisplay.Element;
        RadToolTip1.Position = ToolTipPosition.MiddleRight;
        RadToolTip1.Overlay = true;
 
       
            RadToolTip1.ShowEvent = Telerik.Web.UI.ToolTipShowEvent.OnClick;
            RadToolTip1.Show();
            
         
 
 
    }


And here is my defect: It is coming perfectly for first 12 elements which loads on page refresh. But the moment i scroll down and then select and item in radlistbox . Tooltip  position goes up. I have tried many things. please help me asap.

Screenshot of problem. please use Google chrome to check my problem.

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 16 Sep 2011, 03:09 PM
Hello Ashirvad,

There are some difficulties under WebKit browsers when the content is scrolled, as these browsers do not return proper dimensions in some scenarios. In this case I was able to get this working correctly by manually adjusting the tooltip's position in its OnClientShow event (you should not do it earlier, as this is the first point where it is guaranteed that its UI is rendered). You can find attached my test page and a video from my experiment: http://screencast.com/t/d1BubZ3MfCE.

On a side note - I would recommend setting the properties in the markup of the RadToolTIp instead of each time in the code-behind. Also you need the ClientID of the target element, not its UniqueID.

For this workaround in particular I would advise that you do not use animations, as they postpone the OnClientShow event, which in turn makes the reposition jump more visible.


Kind regards,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
ashirvad
Top achievements
Rank 1
answered on 17 Sep 2011, 05:44 AM
HI Team,
Thanks for your support. It worked. Also i set Animation="None". So that the defect wont be visible.
Thanks again :)
Reagards
AShirvad
Tags
ToolTip
Asked by
ashirvad
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
ashirvad
Top achievements
Rank 1
Share this question
or