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

Create TreeListView programatically

1 Answer 87 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
ss asked on 09 Jul 2010, 10:10 AM


I have TreeListView that contains 4 columns (Title, Name, Age, Street)

I have also class User 

public class User


public String Title;

public String Name;

public int Age;

public String Street;


Now I would like to create TreeListView programatically but I dont know how to bind User properties to columns. Can you please help me how to do this?

Thank you very much.

1 Answer, 1 is accepted

Sort by
Rossen Hristov
Telerik team
answered on 12 Jul 2010, 09:26 AM
Hello ss,

Here is an example of a TreeListView:

<UserControl x:Class="Telerik.Windows.Examples.TreeListView.FirstLook.Example"
        <local:RadTreeListXmlDataSource x:Key="TreeListSource"
                Source="RadRibbonBarCodeCoverage.xml" />
        <local:RelativeBlocksValueConverter x:Key="RelativeBlocksValueConverter1" />
        <local:ItemImageSourceValueConverter x:Key="ItemImageSourceValueConverter1" />
    <Grid x:Name="LayoutRoot">
        <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" Grid.RowSpan="3" />
        <telerik:RadTreeListView x:Name="RadTreeListView1"
                                 ItemsSource="{StaticResource TreeListSource}">
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding BlocksNotCovered}" Header="Not Covered (Blocks)" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Converter={StaticResource RelativeBlocksValueConverter1}, ConverterParameter=0}"
                                            Header="Not Covered (%)" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding BlocksCovered}" Header="Covered (Blocks)" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Converter={StaticResource RelativeBlocksValueConverter1}, ConverterParameter=1}"
                                            Header="Covered (%)" />

We will release our Q2 version very soon and you will be able to see the complete example.

Sincerely yours,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question