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

Set Custom ItemTooltip Using MVVM

1 Answer 88 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Martyn
Top achievements
Rank 1
Martyn asked on 28 Feb 2012, 11:07 PM
Hi,

I have a set of RadCharts each containing the standard tooltip set using the ItemTooltipFormat property.

However, I want to customise the Tooltip control further, but, the documentation only says how to do this using the ItemTooltipOpening event, which is unsuitable for me as my project is using MVVM and so I cannot handle the event in the code behind.

I've thought about using EventToCommand, but this is unsuitable as I can only pass one property as the command parameter this way, whereas I need both the EventArgs and the Tooltip.

Please tell me this is possible and how I would go about doing it.

Thanks very much,

Martyn.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 02 Mar 2012, 05:15 PM
Hi Martyn,

First of all I should say that using the ItemTooltipOpening in code-behind doesn't breaks the concept of MVVM.  However this is my opinion - it's up to you to embrace it or not.

The example attached below demonstrates how you may show customized tooltips with the use of RadTooltipService and without any code-behind. Here's a short explanation of the approach - you should retemplate your series definition and add your own DataTemplate that will be used to visualize the tooltip. The content of the tooltip comes from the propeties of the DataItem.

Let me know how this works for you.

Evgenia
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
Martyn
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or