c# - What is the Best way to databind an ASP.NET TreeView for table with many to many parent child relationships -


I have a table with normal parent ID, childID as it is the first two columns in self-referenced tree data structure.

My point is that when I drag it out and use the following code:

  DataSet set = DA.GetNewEngine (); Set up relation. Set (Set new "DateRail" (Set "Parents Girls", Set Tables [0]. [[Category "ID"]) [column] [["Category ID"]]. Stringbuilder build xml = new stringbiller (); StringWriter Writer = New StringWriter (Build xml); Set.WriteXml (author); Tree View 2.DataSource = New Hierarchical Data Set (Set, "Cadre ID", "CategoryPaint IDID"); TreeView2.DataBind ();  

I get an error:

  These columns do not currently have unique values ​​ 

I believe That is because it is because many parents of my data are children with nodes, it is okay for my application - I have no problem that a line of data is presented in several nodes of my tree view.

Can anyone shed light on this? This does not look unfair to a dataset render XML, where nodes are displayed in many places, but I do not understand how to do it.

Thank you,

Matt

The third column may be (parentID + "_" + categoryId) and using that column in the hierarchical data set, it will be unique through your tree

and you also do this for parent ID So that they match the category ID


Comments