dataset - set parent child relations
Posted
by Night Walker
on Stack Overflow
See other posts from Stack Overflow
or by Night Walker
Published on 2010-03-08T15:18:50Z
Indexed on
2010/03/08
15:21 UTC
Read the original article
Hit count: 575
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();
© Stack Overflow or respective owner