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

PivotMap in SP1 Q2

3 Answers 35 Views
TreeMap and PivotMap
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 22 Sep 2011, 01:48 PM
Hello!

Can you give me a sample how to create Pivot Map with SP1 Q2.

Because after update I cannot see any items.
I do following (according your demo):

PivotMap.LayoutStrategy = new SquarifiedStrategy();
PivotMap.GroupDefinitions.Add(new GroupDefinition() { Member = "Genre" });
PivotMap.ValuePath = "GrossSales";
PivotMap.LabelPath = "Name";
PivotMap.ToolTipPath = "GrossSales";
PivotMap.ToolTipFormat = "Gross Sales: {0:C0}";
 
List<MovieInfo> list = new List<MovieInfo>();
list.Add(new MovieInfo() { GrossSales = 123, Name = "A1", Genre = "A"});
list.Add(new MovieInfo() { GrossSales = 123, Name = "A2", Genre = "A" });
list.Add(new MovieInfo() { GrossSales = 123, Name = "B1", Genre = "B" });
 
PivotMap.ItemsSource = list;

And I don't see any items.
Thanks, Anatoly Chekh.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 26 Sep 2011, 08:13 AM
Hello Alex,

We created a small application using your code and it worked as expected. Perhaps the problematic code is elsewhere. I have attached the the test application so that you can test it in your environment.

Kind regards,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Anatoly Chekh
Top achievements
Rank 1
answered on 01 Oct 2011, 10:50 AM
Hello!

Yes, this solution works fine.
But If I have some another implementation. I have own control that inherits grid. And add to this control RadPivotMap. In this case you solution isn't work.

public class PivotMapContainer : Grid
{
    public PivotMapContainer()
    {
          Chilren.Add(new RadPivotMap());
    }
}
...
Xaml:
<UserControl>
    <PivotMapContainer />
</UserControl>

Thaks, Anatoly Chekh.
0
Yavor
Telerik team
answered on 03 Oct 2011, 09:49 AM
Hello Anatoly Chekh,

RadPivotMap implements ISupportInitialze interface for batch initializing of its properties. The xaml parser calls it automatically, but when you create it in code behind you have to call it manually like this:

public PivotMapContainer()
{
    RadPivotMap PivotMap = new RadPivotMap();
    PivotMap.BeginInit();
    this.Children.Add(PivotMap);
 
    // Initialize
    PivotMap.LayoutStrategy = new SquarifiedStrategy();
    PivotMap.GroupDefinitions.Add(new GroupDefinition() { Member = "Genre" });
    PivotMap.ValuePath = "GrossSales";
    PivotMap.LabelPath = "Name";
    PivotMap.ToolTipPath = "GrossSales";
    PivotMap.ToolTipFormat = "Gross Sales: {0:C0}";
 
    List<MovieInfo> list = new List<MovieInfo>();
    list.Add(new MovieInfo() { GrossSales = 123, Name = "A1", Genre = "A" });
    list.Add(new MovieInfo() { GrossSales = 123, Name = "A2", Genre = "A" });
    list.Add(new MovieInfo() { GrossSales = 123, Name = "B1", Genre = "B" });
 
    PivotMap.ItemsSource = list;
    PivotMap.EndInit();
}

I have attached the sample application modified to your scenario working as expected.
Hope this helps! Kind regards,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeMap and PivotMap
Asked by
Alex
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Anatoly Chekh
Top achievements
Rank 1
Share this question
or