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

Tooltip binding

1 Answer 184 Views
ProgressBar
This is a migrated thread and some comments may be shown as answers.
Etienne
Top achievements
Rank 1
Etienne asked on 14 Nov 2014, 06:29 PM
Hi,

I'm trying to add a tooltip to a radProgressBar and I'm having some issues.

I did something like that but it doesn't work, it gives an empty tooltip :
<telerik:RadProgressBar>
     <telerik:RadProgressBar.ToolTip>
          <ToolTip Content="{Binding Path=DataContext.SomeProperty, ElementName=SomeParent}"/>
     </telerik:RadProgressBar.ToolTip>
</telerik:RadProgressBar>

Same result for this :
<telerik:RadProgressBar telerik:RadToolTipService.ToolTipContent="{Binding Path=DataContext.SomeProperty, ElementName=SomeParent}"/>

The only way I've been able to have something interesting is by doing this :
<telerik:RadProgressBar ToolTip="{Binding Path=DataContext.SomeProperty, ElementName=SomeParent"/>

The problem is that I want to use ContentStringFormat and do something like this :
<telerik:RadProgressBar>
     <telerik:RadProgressBar.ToolTip>
          <ToolTip Content="{Binding Path=DataContext.SomeProperty, ElementName=SomeParent}" ContentStringFormat="{}{0:P2}"/>
     </telerik:RadProgressBar.ToolTip>
</telerik:RadProgressBar>

Am I doing somthing wrong or there is a bug with tooltip ?

Thank you,

Etienne

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 18 Nov 2014, 08:50 AM
Hi Etienne,

There might be some differences when you define the ToolTip inline and when you define it with extended markup syntax 
<telerik:RadProgressBar.ToolTip>
               <ToolTip
especially with how the DataContext is transferred because the tooltip uses Popup and Popups are usually in separate visual tree. However, I believe it is possible to workaround such limitations either with manual setting of DataContext or with a Converter. As for the ProgressBar , you can replace it with System.Windows.Controls.Button to check if the problem is not in Telerik Controls. On the other hand, for the binding issues you can refer to some stackoverflow posts.

WPF binding with StringFormat doesn't work on ToolTips

You can also send us an isolated sample in a separate support thread. This way we would be better able to investigate your scenario and advice you better.

Regards,
Petar Mladenov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ProgressBar
Asked by
Etienne
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or