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

one child having multiple parents concept is not working and throughing error

1 Answer 29 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kavi
Top achievements
Rank 1
Kavi asked on 08 Nov 2011, 06:31 AM
Hey,

     we are in main development phase. i strucked in middle of the development as i am not able bind the treeview when one child has multiple parents.

    But i wanna to achieve this in any way as it is our main concept of development. Please find the below structure.

 

 

DataTable data = new DataTable();

 

data.Columns.Add(

 

"ParentID");

 

data.Columns.Add(

 

"ChildID");

 

data.Columns.Add(

 

"Text");

 

data.Rows.Add(

 

null, "1", "Market 1");

 

data.Rows.Add(

 

null, "2", "Market 2");

 

data.Rows.Add(

 

"1", "1", "1_Client");

 

data.Rows.Add(

 

"1", "2", "2_Client");

 

data.Rows.Add(

 

"2", "1", "1_Client");

 

data.Rows.Add(

 

"2", "4", "4_Client");

 

data.Rows.Add(

 

"2", "5", "5_Client");

 

 

radTreeClientMarket.DataFieldID =

 

"ChildID";

 

radTreeClientMarket.DataFieldParentID =

 

"ParentID";

 

radTreeClientMarket.DataTextField =

 

"Text";

 

radTreeClientMarket.DataSource = data;

radTreeClientMarket.DataBind();

here , child "1_client" is having two parents and my tree view also should be in the way around.

Please reply me as soon as possible as all stopped in this.

Thanks,
Priya

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Nov 2011, 07:22 AM
Hello Kavi,

The following help article will help you to achieve your scenario.
Binding to Hierarchical Data.

Thanks,
Shinu.
Tags
TreeView
Asked by
Kavi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or