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

radtreeview not bind

4 Answers 74 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
niloofar
Top achievements
Rank 1
niloofar asked on 14 Sep 2010, 11:36 AM
hi
i used this url :http://mono.telerik.com/TreeView/Examples/Programming/DataBinding/DefaultCS.aspx
tvActionsTreeView.DataTextField = "Text";
                RAdtreeview1.DataNavigateUrlField = "Url";
                RAdtreeview1.DataFieldID = "ID";
                RAdtreeview1.DataFieldParentID = "ParentID";
                RAdtreeview1.DataSource = CDSStockLogic.BusinessObjects.UI.Actions.GetAll();
                RAdtreeview1.DataBind();
RAdtreeview1.DataSource is full
my data:
ID             Url                  ParentID              Text
----------------------------------------------------------------
0            null                 -1                          text1
1            null                   0                         text2
2           null                    0                         text3
3            null                   1                         text4
4            null                   1                         text5

but radtreeview not bind and is empty
please help

4 Answers, 1 is accepted

Sort by
0
niloofar
Top achievements
Rank 1
answered on 14 Sep 2010, 12:26 PM
please help
0
niloofar
Top achievements
Rank 1
answered on 15 Sep 2010, 06:18 AM
i need to your help
0
T. Tsonev
Telerik team
answered on 16 Sep 2010, 12:56 PM
Hi,

Try changing the ParentID of the root node to 0 instead of -1. The node IDs should start from 1 to match. The TreeView should now be able to pick-up the hierarchy.

I hope this helps.

Best wishes,
Tsvetomir Tsonev
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
0
Cori
Top achievements
Rank 2
answered on 16 Sep 2010, 02:45 PM
Or allow your ParentID field to accept nulls and set -1 to null. That way it knows there is no parent for item with ID 0. That's how I create self-referencing tables.

I hope that helps.
Tags
TreeView
Asked by
niloofar
Top achievements
Rank 1
Answers by
niloofar
Top achievements
Rank 1
T. Tsonev
Telerik team
Cori
Top achievements
Rank 2
Share this question
or