Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1440
ultratree cannot form a hierarchical tree view layout from a single DataTable using DataSet and DataSet Relation
posted

It seems the ultratree cannot  form a hierarchical tree view layout from a single DataTable. I have a simple table which contains four columns and  I want to have parent child relationships between the columns. I want the first column to be the parent of the second column, the second columns to be the parent of the third column, and the third column to be the parent of the fourth column.  The DataTable was place in a DataSet and the DataSet’s Relation property was used to create parent child relationship between the columns as described above. When the ultratree’s SetDataBinding method was used to bind to the dataset with the parenet child relationships specifiedt nothing what displayed in the ultratree.

 Below is simple example

 

·         Here is what the table looks like

Column1           Column2           Colum3             Column4

event                sports               baseball            45

event                sports               baseball            93

event                sports   football 1

event                music               classical           33

event                music               classical           44

performace       drugs                steroids            111

performace       drugs                medicine           225

performace       equipment         weight               111

performace       stuff                 pay                   225

performace       stuff                 pay                   275

performace       xyz                   pay                   275

 

·         The name of the table would be equipment.

·         This table is stored in a DataSet object.

 

·         The relationship in code was creates using the DataSet obect.

dataSet.Relations.Add("parentone", dataSet.Tables["equipment"].Columns["Column1"], dataSet.Tables["equipment"].Columns["Column2"], false);

 

dataSet.Relations.Add("parenttwo", dataSet.Tables["equipment"].Columns["Column2"], dataSet.Tables["equipment"].Columns["Column3"], false);

 

dataSet.Relations.Add("parentthree", dataSet.Tables["equipment"].Columns["Column3"], dataSet.Tables["equipment"].Columns["Column4"], false);

 

 

·         The DataSet object was bound to the ultratree with the relationships specified

  ultraTree1.SetDataBinding(dataSet, " Column1. Column2. Column3");

 

·         When the ultratree was displayed it is blanked.

 

Any opinions on why nothing is displayed in the ultratree?

Parents
No Data
Reply Children
No Data