Hi Everyone,
Following is my requirement,
I'll get a list of names from the service as a collection and need to bind this collection to a RadTreeView and I need to add a root node named "List of Names". Plz help me in doing this and it's very urgent.
My Code:
Thanks,
Prakash.
Following is my requirement,
I'll get a list of names from the service as a collection and need to bind this collection to a RadTreeView and I need to add a root node named "List of Names". Plz help me in doing this and it's very urgent.
My Code:
public
class Employees
{
public string Name { get; set; }
}
List
<Employees> items = new List<Employees>();
items.Add(
new Employees { Name = "name1" });
items.Add(
new Employees { Name = "name2" });
Employees item1 = new Employees { Name = "name3" };
items.Add(item1);
NameTree.ItemsSource = items;
<
telerik:RadTreeView x:Name="NameTree" Margin="0" Grid.Row="0" ItemsSource="{Binding }" BorderThickness="0">
<telerik:RadTreeView.ItemTemplate>
<telerik:HierarchicalDataTemplate >
<TextBlock Text="{Binding Name}"/>
</telerik:HierarchicalDataTemplate>
</telerik:RadTreeView.ItemTemplate>
</telerik:RadTreeView>
Thanks,
Prakash.