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

DataFieldParentID

2 Answers 91 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Regeesh Joseph
Top achievements
Rank 1
Regeesh Joseph asked on 31 Jul 2010, 10:59 AM
Hai,

I have a dataset having fields in the following way :

Flight_Id    Flight_Name   Sector_Id      Sector_Name
----------------------------------------------------------------------------
1                    A                        100                a
2                    B                        200                b
3                    C                        300                c

I want a treeview with Flight_Name as parent nodes and corresponding sector_Name as its child nodes.

Can anybody give some sample code to bind the treeview like this?

Thanks & regards,
Regeesh Joseph

2 Answers, 1 is accepted

Sort by
0
Regeesh Joseph
Top achievements
Rank 1
answered on 02 Aug 2010, 09:18 AM
What is the use of DataFieldParentID in the case of child node binding?
0
Nikolay Tsenkov
Telerik team
answered on 02 Aug 2010, 09:24 AM
Hi Regeesh Joseph,

Well, you probably will have to change the relation a bit (if this is not possible than you can extract the needed view of the data with some more complex query).
Since you can only bind the treeView to a single data source, you can not divide the two types of nodes in different data sources.

But you can always bind the treeView with custom method running on the server, extracting data from the data source and dynamically creating nodes of it.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
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
Tags
TreeView
Asked by
Regeesh Joseph
Top achievements
Rank 1
Answers by
Regeesh Joseph
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or