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

Namespace is visible in tooltip and text is shown.

5 Answers 113 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Psyduck asked on 26 Apr 2021, 04:40 AM

Hello.

When using the tooltip content separately, the namespace is shown together.

<telerik:RadButton Height="30" Width="30"
                   telerik:RadToolTipService.Placement="Mouse"
                   telerik:RadToolTipService.ShowDuration="5000">
    <telerik:RadButton.Content>
        <TextBlock Text="&#xE72C" FontFamily="Segoe MDL2 Assets"/>
    </telerik:RadButton.Content>
    <telerik:RadToolTipService.ToolTipContent>
        <telerik:RadToolTipContentView >
            <TextBlock Text="ToolTip Name"/>
        </telerik:RadToolTipContentView>
    </telerik:RadToolTipService.ToolTipContent>
</telerik:RadButton>

 

If I use telerik:RadToolTipService.ToolTipContent="Content" it looks correct.

However, the above source was selected because it should be different from the button font setting.

When telerik:RadToolTipContentView is deleted, only other namespaces are shown, textblock content is not.

 

Please check.

Thanks.

5 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Apr 2021, 01:42 PM

Hello KIM,

The RadToolTipService.ToolTipContent attached property supports string content only. This is why the result of the ToString() method of RadToolTipContentView is shown in the tooltip. To achieve your requirement, you can use the RadToolTipService.ToolTipContentTemplate property.

<telerik:RadButton Height="30" Width="30"
                   telerik:RadToolTipService.Placement="Mouse"
                   telerik:RadToolTipService.ShowDuration="5000"
				   telerik:RadToolTipService.ToolTipContent="ToolTip Name">
    <telerik:RadButton.Content>
        <TextBlock Text="&#xE72C" FontFamily="Segoe MDL2 Assets"/>
    </telerik:RadButton.Content>
    <telerik:RadToolTipService.ToolTipContentTemplate>
		<DataTemplate>
			<telerik:RadToolTipContentView >
				<TextBlock Text="{Binding}"/>
			</telerik:RadToolTipContentView>
		</DataTemplate>
    </telerik:RadToolTipService.ToolTipContentTemplate>
</telerik:RadButton>

Regards,
Martin Ivanov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 28 Apr 2021, 12:14 AM

Hello.

 

I'm sorry I just thought of that.

In that case, you can put a string in telerik: RadToolTipService.ToolTipContent, but I wanted to do a custom.

 

Like this.


<telerik:RadButton Height="30" Width="30"
                   telerik:RadToolTipService.Placement="Mouse"
                   telerik:RadToolTipService.ShowDuration="5000">
    <telerik:RadButton.Content>
        <TextBlock Text="&#xE72C" FontFamily="Segoe MDL2 Assets"/>
    </telerik:RadButton.Content>
    <telerik:RadToolTipService.ToolTipContentTemplate>
		<DataTemplate>
			<telerik:RadToolTipContentView >
				<TextBlock Margin="3"> <Underline>T</Underline>oolTip <Bold>Name</Bold></TextBlock>
			</telerik:RadToolTipContentView>
		</DataTemplate>
    </telerik:RadToolTipService.ToolTipContentTemplate>
</telerik:RadButton>

 

However, this does not reflect underline or bold, and it is displayed the same as the image of the first post.
How can I fix this?

Thansk.

0
Martin Ivanov
Telerik team
answered on 30 Apr 2021, 10:46 AM

Hello KIM,

If you want to add UI elements (like RadToolTipContentView) in the tooltip, please use the ToolTipContentTemplate property.

<telerik:RadToolTipService.ToolTipContentTemplate>
	<DataTemplate>
		<telerik:RadToolTipContentView >
			<TextBlock Text="ToolTip Name"/>
		</telerik:RadToolTipContentView>
	</DataTemplate>
</telerik:RadToolTipService.ToolTipContentTemplate>

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 03 May 2021, 01:21 AM | edited on 03 May 2021, 01:22 AM

Hello.

 

What's different from what I wrote above?

And when 'ToolTipContentTemplate - DataTemplate - RadToolTipContentView' is used, Tooltip is not visible.

I'll rewrite the question below.

 

Tooltip is shown. (Namespace include text, textblock style not applied: underline, bold)

<telerik:RadButton Height="30" Width="30"
                   telerik:RadToolTipService.Placement="Mouse"
                   telerik:RadToolTipService.ShowDuration="5000">
	<telerik:RadButton.Content>
		<TextBlock Text="&#xE72C" FontFamily="Segoe MDL2 Assets"/>
	</telerik:RadButton.Content>
	<telerik:RadToolTipService.ToolTipContent>
		<telerik:RadToolTipContentView >
			<TextBlock Margin="3"> <Underline>T</Underline>oolTip <Bold>Name</Bold></TextBlock>
		</telerik:RadToolTipContentView>
	</telerik:RadToolTipService.ToolTipContent>
</telerik:RadButton>

 

 

Tooltip not visible. Unable to check textblock.

<telerik:RadButton Height="30" Width="30"
                   telerik:RadToolTipService.Placement="Mouse"
                   telerik:RadToolTipService.ShowDuration="5000">
	<telerik:RadButton.Content>
		<TextBlock Text="&#xE72C" FontFamily="Segoe MDL2 Assets"/>
	</telerik:RadButton.Content>
	<telerik:RadToolTipService.ToolTipContentTemplate>
		<DataTemplate>
			<telerik:RadToolTipContentView >
				<TextBlock Margin="3"> <Underline>T</Underline>oolTip <Bold>Name</Bold></TextBlock>
			</telerik:RadToolTipContentView>
		</<DataTemplate>
	</telerik:RadToolTipService.ToolTipContentTemplate>
</telerik:RadButton>


Thanks.

1
Accepted
Martin Ivanov
Telerik team
answered on 05 May 2021, 01:09 PM

Hello KIM,

Thank you for the summarized information. To resolve this, you will need to set also the RadToolTipService.ToolTipContent property along with RadToolTipService.ToolTipContentTemplate. In order for the template  to be displayed the content should be set to a value. In your case, it can be an empty string.

<telerik:RadButton Height="30" Width="30"
				   telerik:RadToolTipService.ToolTipContent=""
		   telerik:RadToolTipService.Placement="Mouse"
		   telerik:RadToolTipService.ShowDuration="5000">
	<telerik:RadButton.Content>
		<TextBlock Text="&#xE72C;" FontFamily="Segoe MDL2 Assets"/>
	</telerik:RadButton.Content>
	<telerik:RadToolTipService.ToolTipContentTemplate>
		<DataTemplate>
			<telerik:RadToolTipContentView >
				<TextBlock Margin="3"> <Underline>T</Underline>oolTip <Bold>Name</Bold></TextBlock>
			</telerik:RadToolTipContentView>
		</DataTemplate>
	</telerik:RadToolTipService.ToolTipContentTemplate>
</telerik:RadButton>

Regards,
Martin Ivanov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
ToolTip
Asked by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Martin Ivanov
Telerik team
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Share this question
or