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
=
""
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
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="" 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.
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="" 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.
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/.
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="" 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="" 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.
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="" 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.