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
660
How can I retrieve database fields for each level from Web Tree?
posted


Hi

I want to know how can I retrieve database fields for each level from Web Tree.  for example I have a webTree control with 3 levels.  This is bound to the database as follows:

 

dsmain.Relations.Add("BPSec",

dsmain.Tables["BP"].Columns["bp_id"],

dsmain.Tables["Sec"].Columns["bp_id"]);

dsmain.Relations.Add("SecMR",

dsmain.Tables["Sec"].Columns["sec_id"],

dsmain.Tables["MR"].Columns["sec_id"]);

this.treeMain.Levels[0].LevelKeyField = "name";

this.treeMain.Levels[1].LevelKeyField = "name";

this.treeMain.Levels[2].LevelKeyField = "approved_ts";

 

this.treeMain.Levels[0].LevelImage = "ig_treeNews.gif";

this.treeMain.Levels[0].RelationName = "BPSec";

this.treeMain.Levels[0].ColumnName = "name";

this.treeMain.Levels[1].RelationName = "SecMR";

this.treeMain.Levels[1].ColumnName = "name";

this.treeMain.Levels[2].ColumnName = "approved_ts";

this.treeMain.DataMember = "BP";

this.treeMain.DataSource = dsmain;

this.treeMain.DataBind();

 

_________________________________________________________

 

It works fine.  So, now for example if I click on the 3rd level in the tree, how do I retrieve all the corresponding values from the tree object?  I would need the ID of the first level, ID of the second level, and ID of the third level at a minimum.  Can I just use some format like :  treeMain.nodes.levels[3].fields["ID"]....... or something similar like that?  I am hoping it is this easy.  I took a look at the documentation, but couldn't find a clear indication of what objects I would need to get the desired values.

Thanks!

 

 

Parents Reply Children
No Data