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

[Solved] TreeView - Binding to Hierarchical Data

1 Answer 153 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mfrimu
Top achievements
Rank 1
mfrimu asked on 06 Feb 2009, 10:45 PM
Hello,

I'm trying to bind the TreeView to hierarchical data in a table. I used ItemID and ParentID, but tree ignores hierarchy.

<telerik:RadTreeView ID="RadTreeView1" Runat="server"   
        DataSourceID="LinqDataSource1" DataFieldID="ItemID" DataFieldParentID="ParentID"   
        DataTextField="Title" EnableAjaxSkinRendering="true" Skin="Default"   
        CausesValidation="False" EnableDragAndDrop="True"   
        EnableDragAndDropBetweenNodes="True" MaxDataBindDepth="25"   
        SingleExpandPath="True" Width="350px"   > 
        <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> 
        <ExpandAnimation Duration="100"></ExpandAnimation> 
</telerik:RadTreeView> 
    <br /> 
    <br /> 
      
 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"   
        ContextTypeName="DataClassesDataContext" OrderBy="ParentID, SortOrder"   
        TableName="Items" Where="ClientID == @ClientID">  
        <WhereParameters> 
            <asp:ControlParameter ControlID="DropDownList1" DefaultValue="1"   
                Name="ClientID" PropertyName="SelectedValue" Type="Int64" /> 
        </WhereParameters> 
    </asp:LinqDataSource> 
 


The tree displays all data as if it's on the root node.

Please help,

Michael

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 27 Jan 2010, 02:25 PM
Did you ever get this resolved?
Tags
TreeView
Asked by
mfrimu
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Share this question
or