dioulos
Messages postés1Date d'inscriptionjeudi 12 février 2004StatutMembreDernière intervention12 février 2004
-
12 févr. 2004 à 16:55
cs_fabrice69
Messages postés1765Date d'inscriptionjeudi 12 octobre 2000StatutMembreDernière intervention11 décembre 2013
-
13 févr. 2004 à 00:04
Hi,
Je voudrais cree un IE TreeView avec ASP.NET en CSharp, jusqu'a present je suis arrive a faire apparaitre les parent and le enfant direct. Malheureusement, je n'arrive pas a exposer les enfants des enfants un si de suite...
Ci -dessous est la structure de mon database:
Index | Name | ParentIndex
1 | pierre | 0
2 | paul | 0
3 |jean | 1
4 | tele | 3
5 | papier |4 <---- j'ai des problem a exposer cette ---------------------------------information
public TreeNodeCollection populateTreeNode (string db, string tableName,Microsoft.Web.UI.WebControls.TreeNodeCollection nodes){
TreeNode child = null;
TreeNode par = null;
this.producePopulatedTableDS(db,tableName);
for ( int x=0; x < this.TREE_ARRAY.Count; x++) {
for (int y=0; y <((ArrayList)this.TREE_ARRAY[x]).Count; y++) {
par = (TreeNode)((ArrayList)this.TREE_ARRAY[x])[y]; //Array of Node
for (int z=0; z < ((ArrayList)this.TREE_ARRAY[y+1]).Count; z++) {
child = (TreeNode)((ArrayList)this.TREE_ARRAY[y+1])[z];
if( par.ID == child.ChildType) {
par.Nodes.Add(child);
}
}//third for
if( par.ID == child.ChildType){
nodes.Add (par); this.TREENODECOLLECTION = nodes;
}
}//second for
}//first
return this.TREENODECOLLECTION;
}//End populateTreeNode
//OleDbDataReader aReader = this.SELECTED_CMD.ExecuteReader();
this.DISTINCT = this.distinct (tableName,"parent");
//Go through array of distinct number
this.TREE_ARRAY = new ArrayList ();
for (int x=0; x <this.DISTINCT.Count; x++) {
this.builtParentSet (distinctList,tableName,x);
}
int count = this.TREE_ARRAY.Count ;