2 tooltip

4 posts, 0 answers
  1. Eva Stephen
    Eva Stephen avatar
    14 posts
    Member since:
    Dec 2009

    Posted 17 Dec 2009 Link to this post

    Hi,

    I need to apply two Showevent(OnClick,OnMouseOver) for one control.Here is my code.

     

     

    <

     

    telerik:RadToolTipManager runat="server" ID="RadToolTipOnClick" HideEvent="LeaveTargetAndToolTip"

     

     

    ShowEvent="OnClick" OnClientShow="OnClientShow" Skin="Windows7" Width="100px" Height="20px"

     

     

    ShowDelay="100" Sticky="true" AutoCloseDelay="5000" Position="MiddleRight" RelativeTo="Element" >

     

     

    </telerik:RadToolTipManager>

     

     

     

     

     

     

     

    <telerik:RadToolTipManager runat="server" ID="RadToolTipOnMouseOver" HideEvent="LeaveTargetAndToolTip"

     

     

    ShowEvent="OnMouseOver" OnClientShow="OnClientShow" Skin="Windows7" Width="100px" Height="20px"

     

     

    ShowDelay="100" Sticky="true" AutoCloseDelay="5000" Position="MiddleRight"RelativeTo="Element" >

     

     

    </telerik:RadToolTipManager>

    On Code behind

     

    txtBox.ToolTip = fieldDescription.Description;

     

    RadToolTipOnClick.TargetControls.Add(txtBox);

    RadToolTipOnMouseOver.TargetControls.Add(txtBox);

    But tooltip returns empty for Mouseover.Please refer attachment for more reference.
    Please let me know what i'm missing here.

    Thanks for all your support.
    Eva


    But for

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 18 Dec 2009 Link to this post

    Hello Eva,

    Would you please explain how exqactly you populate the text in the tooltip? If you do this by setting ToolTip/Title property of the target control, the behavior you report is expected because the first tooltip manager gets the text, creates a tooltip and displays it in it and removes the title form the target to prevent the browser tooltip to show as well (this will result in both a RadToolTipo and a standard browser tooltip which is not desired). That is why when the seciond manager should tooltipify the target, the title attribute is already removed and thus it creates and shows a blank tooltip.

    If this is the case, what I can suggest is to set the desired text as a value and to set it in the OnAjaxUpdate event.


    Best wishes,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eva Stephen
    Eva Stephen avatar
    14 posts
    Member since:
    Dec 2009

    Posted 18 Dec 2009 Link to this post

    Hi Svetlina ,
    Could you please provide an code sample for OnAjaxUpdate event. I saw this demo
    http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx with radgrid.

    But in my case i need to apply Showevent for all the textbox control in the page.
    Thanks.
    Eva
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 19 Dec 2009 Link to this post

    Hi Eva,

    The ShowEvent is specified in teh markup declaration (or dynamically in code behind). However, it is not directly related to the OnAjaxUpdate event and should not be set there. The OnAjaxUpdate event is used only to populate the content of the tooltip. This being said, in ordre to add tooltips to your textbox, you should go through the following steps:

    1) Add the textboxes to the TargetControls collection - you can do this on teh server or in the markup.
    2) When you add each textbox, add a Value - it can be the string you want to show or a primary key value which should be used to extract information from a DB.
    3) In the OnAjaxUpdate (you can have the same handler for both if the tooltips should have the same information) you put the content of the toooltip.

    This approach is shown in all the LOD demos, including the one you have linked. The only difference between the demo you have examined and your setup is that you do not have an event as ItemDataBound where to attach tooltips but you can simply iterate through the textboxes or even easier - set them in the markup.



    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top