dataset - set parent child relations
- by Night Walker
Hello all
I am trying to set the relations of rows in DataSet and then to show that relation in XTraaTreeList as tree with relations.
|
--|
----|
but i get
|
|
|
I am doing this code but i get a view without any relations i get them all in one level.
Any idea what i am doing wrong ?
this.treeList1.BeginUpdate();
this.dataTable1.Clear();
DataRow dr = this.dataTable1.NewRow();
dr[0] = "father";
dr[1] = true;
dr[2] = "ddd";
this.dataTable1.Rows.Add(dr);
DataRow dr1 = this.dataTable1.NewRow();
dr1[0] = "son";
dr1[1] = true;
dr1[2] = "ddd";
dr1.SetParentRow(dr);
this.dataTable1.Rows.Add(dr1);
DataRow dr2 = this.dataTable1.NewRow();
this.dataTable1.ParentRelations()
dr2[0] = "grand son";
dr2[1] = true;
dr2[2] = "ddd";
dr2.SetParentRow(dr1);
this.dataTable1.Rows.Add(dr2);
this.treeList1.EndUpdate();