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

Loading Tree from database

1 Answer 81 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
suryaprakash
Top achievements
Rank 1
suryaprakash asked on 23 Sep 2010, 12:11 PM
Hi ,

I am planning to purchase Telerik, if it supports following scenerio.


I have data in  sql ,with 3 columns in a table

(PK)column1 : navigationID
Column2: ParentID
Column3: Description

Rows are as follows:

Row1    1   1   Welcome
Row2   2    1   home
Row3    3   2   subhome1
Row4    4   2  subhome2
Row5    5   1    Contact us


I need to display same  in Front end with context menu(Add nod,edit node, delete node) on each node. and when I add new node it should insert to above table with respect to there parent.

I created one sqldatasource and added above table. and for tree control i reffered above 3 columns . for  DataFieldID = navigationID,DAtaFieldParentID=ParentID  and DataFieldTextField =Description but for some reasons I can not see any results in front end.

* could you please give me example or sample code where I can follow similar scenerio

Thanks and Regards,
Michael




1 Answer, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 24 Sep 2010, 02:52 PM
I believe the problem is with your first row "Welcome", where it's parent is itself. Set the ParentID for that row to null and then see if it works.

I hope that helps.
Tags
TreeView
Asked by
suryaprakash
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or