Hi,
I have been trying to bind data 3 lists to make a 3 level tree for approx. 10 hours now....
First I would like to say that I am very dissapointed with the difficulty in using the telerik silverlight tools. I have never coded XML, or XAML before, so I will take some of the blame for not being able to get this to work, but, I thought that was the reason for these tools, so that you don't need to know how the inner workings of the program work, so that you can spend more time designing. I think you guys should keep in mind that complete novices are going to be using your tools, and so very minimal coding should be required, that is why I first decided to use telerik's products (ASP.Net is awesome btw). Anyway, that was my little rant... I'm a bit frusterated. So here is my code:
<xaml>
<UserControl.Resources>
<WTXNetSilver:TreeArea x:Key="TreeAreaDS"/>
<DataTemplate x:Key="well">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</DataTemplate>
<core:HierarchicalDataTemplate x:Key="battery" ItemsSource="{Binding well}">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</core:HierarchicalDataTemplate>
<core:HierarchicalDataTemplate x:Key="area" ItemsSource="{Binding battery}">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</core:HierarchicalDataTemplate>
</UserControl.Resources>
Then I call this : <telerikNavigation:RadTreeView x:Name="treeWells" ItemsSource="{Binding Source={StaticResource TreeAreaDS}}" ItemTemplate="{StaticResource area}" /> in my grid.
</xaml>
(this is my baby... took me 10 hours of scouring the Net/ Trial and error of using the examples, to get to this point.... I'll just wait until you stop laughing.. :) )
Here are my Lists.
public class TreeArea
{
public string Name { get; set; }
public string ID { get; set; }
public List<Battery> battery { get; set; }
}
public class Battery
{
public string Name { get; set; }
public string ID {get;set;}
public List<Well> well { get; set; }
}
public class Well
{
public string Name { get; set; }
public string ID { get; set; }
}
so I populate an area list like this:
treeWells is my Tree.
treeWells.ItemsSource = treeArea;
So what happens is that the Area displays, and I can expand the area to get the battery, but I cannot expand the battery to get the wells.
Area--Battery--- Cannot expand to get wells!!
Also, I tried to use Microsoft Expressions to make the tree automatically, but it won't make more than a 1-teir tree. >:( I was so happy when I found out that I could generate the tree automatically, only to have it turned to horror as I realized that the feature was unfinished.
help would be much appreciated.
Thanks,
Chad
I have been trying to bind data 3 lists to make a 3 level tree for approx. 10 hours now....
First I would like to say that I am very dissapointed with the difficulty in using the telerik silverlight tools. I have never coded XML, or XAML before, so I will take some of the blame for not being able to get this to work, but, I thought that was the reason for these tools, so that you don't need to know how the inner workings of the program work, so that you can spend more time designing. I think you guys should keep in mind that complete novices are going to be using your tools, and so very minimal coding should be required, that is why I first decided to use telerik's products (ASP.Net is awesome btw). Anyway, that was my little rant... I'm a bit frusterated. So here is my code:
<xaml>
<UserControl.Resources>
<WTXNetSilver:TreeArea x:Key="TreeAreaDS"/>
<DataTemplate x:Key="well">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</DataTemplate>
<core:HierarchicalDataTemplate x:Key="battery" ItemsSource="{Binding well}">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</core:HierarchicalDataTemplate>
<core:HierarchicalDataTemplate x:Key="area" ItemsSource="{Binding battery}">
<TextBlock Text="{Binding Name}" Foreground="Green" FontStyle="Italic" />
</core:HierarchicalDataTemplate>
</UserControl.Resources>
Then I call this : <telerikNavigation:RadTreeView x:Name="treeWells" ItemsSource="{Binding Source={StaticResource TreeAreaDS}}" ItemTemplate="{StaticResource area}" /> in my grid.
</xaml>
(this is my baby... took me 10 hours of scouring the Net/ Trial and error of using the examples, to get to this point.... I'll just wait until you stop laughing.. :) )
Here are my Lists.
public class TreeArea
{
public string Name { get; set; }
public string ID { get; set; }
public List<Battery> battery { get; set; }
}
public class Battery
{
public string Name { get; set; }
public string ID {get;set;}
public List<Well> well { get; set; }
}
public class Well
{
public string Name { get; set; }
public string ID { get; set; }
}
so I populate an area list like this:
treeWells is my Tree.
treeWells.ItemsSource = treeArea;
So what happens is that the Area displays, and I can expand the area to get the battery, but I cannot expand the battery to get the wells.
Area--Battery--- Cannot expand to get wells!!
Also, I tried to use Microsoft Expressions to make the tree automatically, but it won't make more than a 1-teir tree. >:( I was so happy when I found out that I could generate the tree automatically, only to have it turned to horror as I realized that the feature was unfinished.
help would be much appreciated.
Thanks,
Chad