RadToolTipService.SetToolTipContent Does not work with none text objects

4 posts, 0 answers
  1. M
    M avatar
    16 posts
    Member since:
    Mar 2012

    Posted 12 Mar 2017 Link to this post

    I have a stackpanel and in code behind using of RadToolTipService.SetToolTipContent method. When I use a text as second parameter all things are good but using an Object , I have an empty tooltip. RadToolTipService.SetToolTipContent(MyStackPanel,MyObject) hear myobject is a complex stackpanel including textblocks and some nested stackpanel. I found If we set a simple text as the second input we are OK .When we send an object (hear stackpanel) we have an empty tooltip. Is there a bug? or there is a solution for this problem ? -  Telerik version is 2016 r3
  2. Milena
    Admin
    Milena avatar
    226 posts

    Posted 15 Mar 2017 Link to this post

    Hello M,

    I'm not quite sure about your scenario. Could you please send us a code-snippet or a sample project to see your implementation? Are you defining the tooltip and the stackpanel in code-behind or in xaml and code-behind? In your case maybe you need to change the ToolTipTemplate.
     
    You can try the following code and see if this works for you: 
    <TextBlock Text="TextBlock" x:Name="mytextblock"
        telerik:RadToolTipService.Placement="Bottom"
        telerik:RadToolTipService.VerticalOffset="-10"
        telerik:RadToolTipService.ToolTipContentTemplate="{x:Null}">
        <telerik:RadToolTipService.ToolTipContent>
            <telerik:RadToolTipContentView>
                <StackPanel>
                <TextBlock Text="Content line 1" />
                <TextBlock Text="Content line 2" />
                </StackPanel>
            </telerik:RadToolTipContentView>
        </telerik:RadToolTipService.ToolTipContent>
    </TextBlock>

    I'm looking forward to your reply.

    Regards,
    Milena
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. M
    M avatar
    16 posts
    Member since:
    Mar 2012

    Posted 05 Apr 2017 in reply to Milena Link to this post

    Hi Milena

    At first I thank you for your attention.I have a stackpanel including some objects(hear some radshape).All of these are in xaml .I try set a tooltip to this stackpanel in code behind (related to real time data ...) . In this case I will have a tooltip on the stackpanel with the default time of 5 . I want to exceed this time . I found that some telerik fetures work for setting of a tooltip . If I replace my scenario with  " a stackpanel including a textbox (and a tooltip with none default time for example 15 seconds in code behind)" it works fine and the timing of 15 seconds works fine . If we replace any none textbox object(s) with the text box , we only can see 5 second the tooltip . My code in codebehind is :

    ToolTipService.SetToolTip((StackPanel)oItemShape.Parent, oBorder);
    ToolTipService.SetPlacement(oItemShape.Parent, System.Windows.Controls.Primitives.PlacementMode.Right);
    Telerik.Windows.Controls.RadToolTipService.SetShowDuration((StackPanel)oItemShape.Parent, 10000);

     

    note:oItemShape.Parent is the my stackpanel that I want to set a tooltip to it. In this scenario 10000 does not work .

    If I replace some objects(radshapes) with one or some textbox , delay timing works fine !

  4. Milena
    Admin
    Milena avatar
    226 posts

    Posted 06 Apr 2017 Link to this post

    Hello,

    I tried to follow your scenario but I'm not quite sure that I understand it. This is why I think that it would be better if you could send us an isolated project where we can take a look at your implementation and provide you with more information.

    In addition, I noticed that in the code-snippet you sent you are using MS ToolTip (ToolTipService) and you set the duration of RadToolTip (RadToolTipService). This could be the reason why the duration property is not respected. 

    Regards,
    Milena
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top