Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
XamTreeMap set ItemSource atcode
posted

Hi,
I want create and binding xamTreeMap at code.
In XAML page I created xamTreeMap:

<ig:XamTreemap x:Name="XamTreeMap_1" LayoutType="Squarified" LayoutOrientation="Horizontal" />


In code I do this:

List

 

 

<Prekess> pr1 = new List<Prekess>();
pr1.Add(
new Prekess { name = "Preke 1", kaina = 10000 });
pr1.Add(
new Prekess { name = "Preke 2", kaina = 1000 });
pr1.Add(
new Prekess { name = "Preke 3", kaina = 20000 });
pr1.Add(
new Prekess { name = "Preke 4", kaina = 7000 });
pr1.Add(
new Prekess { name = "Preke 5", kaina = 15000 });

 

 

List<Prekess> pr2 = new List<Prekess>();
pr1.Add(
new Prekess { name = "Preke 6", kaina = 10000 });
pr1.Add(
new Prekess { name = "Preke 7", kaina = 1000 });
pr1.Add(
new Prekess { name = "Preke 8", kaina = 20000 });
pr1.Add(
new Prekess { name = "Preke 9", kaina = 7000 });
pr1.Add(
new Prekess { name = "Preke 10", kaina = 15000 });

 

 

List<Pelnass> p = new List<Pelnass>();
p.Add(
new Pelnass { id = "Vienas", Prekess = pr1 });
p.Add(
new Pelnass { id = "Du", Prekess = pr2 });

XamTreeMap_1.ItemsSource = p;

XamTreeMap_1.NodeBinders.Add(

 

new Infragistics.Controls.Charts.NodeBinder
{
TargetTypeName =
"Pelnass",
TextPath =
"id",
ItemsSourcePath =
"Prekess"
});

 

XamTreeMap_1.NodeBinders.Add(

 

new Infragistics.Controls.Charts.NodeBinder
{
TargetTypeName =
"Prekes",
TextPath =
"kaina",
ItemsSourcePath =
"name"
});

But it not working.
I see this message:
There are not anyvalid treemap nodes. Please check the items source and the data binders.

Can anyone help me?

Thanks,

Parents
No Data
Reply Children