Hi,
I have a simple RadPivotMap, latest build, defined like this:
<telerik:RadPivotMap x:Name="RadTreeMap" LayoutStrategy="Squarified" ItemsSource="{Binding CountryData}" LabelPath="Country" ValuePath="CountryAmount" ToolTipPath="CountryAmount" ToolTipFormat="{}{0:N0} i/day}"> <telerik:RadPivotMap.GroupDefinitions> <telerik:GroupDefinition Member="Continent"> </telerik:GroupDefinition> </telerik:RadPivotMap.GroupDefinitions></telerik:RadPivotMap>
Data from ViewModel is simple too:
public IEnumerable<CountryItem> CountryData // ... regular MVVM propertypublic class CountryItem{ [Key] public int ID { get; set; } public string Continent { get; set; } public string Country { get; set; } public string CountryAmount { get; set; }}
Using MS DomainContext/DomainDataSource to load data from DB:
_domainDataSource.LoadedData += (_o, _e) => { List<CountryItem> list = new List<CountryItem>(); foreach (vwCountry v in _e.Entities) { list.Add(new CountryItem() { ID = v.ID, Region = v.Region, Country = v.Country, CountryAmount = v.Amount, }); } this.CountryData = list.AsEnumerable(); } };
Now I want to get ToolTip on RadPivotMap's items. If I do it like in Telerik samples
<controls:ChildWindow.Resources> <DataTemplate x:Key="tooltTipTemplate"> ... </DataTemplate></controls:ChildWindow.Resources>then I get 2 exceptions for each CountryData item:
System.Windows.Data Error: Cannot get 'ToolTip' value (type 'System.Object') from 'TreeMapData Value: 145170; ChildrenCount: 0; Depth: 1' (type 'Telerik.Windows.Controls.TreeMap.GroupData'). BindingExpression: Path='ToolTip' DataItem='TreeMapData Value: 145170; ChildrenCount: 0; Depth: 1' (HashCode=27707615); target element is 'Telerik.Windows.Controls.TreeMap.RadTreeMapItem' (Name=''); target property is 'ToolTipContent' (type 'System.Object').. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
System.Windows.Data Error: Cannot get 'ToolTipAvailable' value (type 'System.Boolean') from 'TreeMapData Value: 145170; ChildrenCount: 0; Depth: 1' (type 'Telerik.Windows.Controls.TreeMap.GroupData'). BindingExpression: Path='ToolTipAvailable' DataItem='TreeMapData Value: 145170; ChildrenCount: 0; Depth: 1' (HashCode=27707615); target element is 'Telerik.Windows.Controls.TreeMap.RadTreeMapItem' (Name=''); target property is 'IsEnabled' (type 'System.Boolean').. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
And if I try to set template inside RadPivotMap -
<telerik:RadPivotMap.ToolTipTemplate> <DataTemplate> ... </DataTemplate></telerik:RadPivotMap.ToolTipTemplate>
I get nothing at all - no exceptions, no tooltip
What am I doing wrong?
TIA