I am try to populate the treenodes dynamically from database so I am able to do that in treeview of VS 2005 but with Ultra tree its displayinge me just the parent nodes.what can be the reason?? and I switched to ultratree because I will be displaying 4 columns as child nodes whcih can be modified (edit)....so how will I be able to do that I am a newbee....so please if possible explain me in detail .Thanks
This code works for populating the child node for a simple treeview but not for ultratreeview
TreeNode mainNode = new TreeNode(); mainNode.Text = "Eserver"; this.ultraTree1.Nodes.Add(mainNode.Text); foreach (DataRow row in Eset.Tables[0].Rows) { TreeNode newNode = new TreeNode(); foreach (DataRow rowchild in row.GetChildRows("RelEntLic")) { TreeNode childNode = new TreeNode(); childNode.Text = rowchild["YearsBack"].ToString(); childNode.Tag = rowchild["EntitlementSetID"]; newNode.Nodes.Add(childNode); } newNode.Text = row["FullDeatilsESet"].ToString(); newNode.Tag = row["EntitlementSetID"]; //newNode.SelectedImageIndex this.ultraTree1.Nodes[0].Nodes.Add(newNode.Text); }
What ViewStyle are you using for your tree?
If you are showing multiple column, then how are you creating your ColumnSets?Or did you not get that far, yet?
If you want the tree to show data from a data table, why not simply bind it, rather than copying the data?
I have not got too far ..Is there a sample code I can refer too ,,,,you are correct I have to display the columns from a specific table but based on the parent node I am using relation to relate parentnode [EntitlementsSetID] from table ESERVER to child node [EntitlementSetID] from Table LIC_ENT now I have to display all 4 columns form this child table [LIC_ENT] which a user can edit. I am Using it first time demo vesion ..if it works out i will buy it. Thanks
I'm having trouble understand what you wrote here. SetDataBinding is not working? What exactly is not working?
If the child nodes are not displaying, then your data structure must not be set up with the correct structure.
The samples are installed with NetAdvantage. I really don't know exactly where. I assume it's somewhere under the folder where you installed the NetAdvantage suite. If you can't find it, perhaps you should Submit an incident to Infragistics Developer Support and they can probably tell you more specifically where the samples are installed.
Perhaps at this point, you should submit a sample demonstrating the problem, since it sounds like the issue may be too complex to answer in a forum post.
This is the sample code--> Eset is a DataSet having two tables (el and es)inside it.
this.bindingSource2.DataSource = Eset; this.bindingSource2.DataMember = el.TableName; this.ultraTree1.DataSource = this.bindingSource1; this.ultraTree1.Refresh();
This is where I am populating the root node "Eserver" and then parent nodes "FullDeatilsESet"and the child node "YearsBack". I am using relation on the bases of column and displying the related nodes as child nodes.
TreeNode mainNode = new TreeNode(); mainNode.Text = "Eserver"; this.ultraTree1.Nodes.Add(mainNode.Text); foreach (DataRow row in Eset.Tables[0].Rows) { TreeNode newNode = new TreeNode(); foreach (DataRow rowchild in row.GetChildRows("RelEntLic")) { TreeNode childNode = new TreeNode(); childNode.Text = rowchild["YearsBack"].ToString(); childNode.Tag = rowchild["EntitlementSetID"]; newNode.Nodes.Add(childNode); } newNode.Text = row["FullDeatilsESet"].ToString(); newNode.Tag = row["EntitlementSetID"]; this.ultraTree1.Nodes[0].Nodes.Add(newNode.Text); }
The Problems
The same code works for simple treeview1 but not working for ultraTree1. Not working means its not displaying the child nodes and when I am trying to debug its showing me that it does have the childnode ..i dont know why its not displaying.
2nd problem is that even if its displaying then how can i display all the fields (4 columns"Years Back""Quareters Backs" "LicID" "DataID" )not just "YearsBack".
That is I want to display the whole table with 4 columns as a child node and these nodes should have the property of updating ..I think something like this GRID STYLE
http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR2.0/
If you want any other information do let me know Thanks
TechSam said:this.bindingSource2.DataSource = Eset; this.bindingSource2.DataMember = el.TableName; this.ultraTree1.DataSource = this.bindingSource1; this.ultraTree1.Refresh();
Is this a typo? Or are you actually setting the DataSource and DataMember of one BindingSource and then binding to tree to a completely different BindingSource?
Again, I'm really not sure why the child nodes are not showing up. You should submit a sample project to Infragistics Developer Support so they can check it out.
Thanks a lot for replying back. That was a Typo and to submit to Infragistics Developer Support can you post me the link please where I can submitt them.
Regards
Sam
Hi Sam,
I posted the link above, but here it is again: Submit an incident to Infragistics Developer Support
I don't have it completely solved on the edit part... However...
If you use the custom properties page (right click context menu on the ultraTree control), under tree there is a node called Override there is a property called CellClickAction. Choose one of the EditCell options. Note, this is change quite a few behaviors with the tree, so test your tree extensively to make sure you like the changes....
Now... This allows editing, but unless each specific column/cell has addition configuration, no editing occurs....
I use the custom properties page to design my columns in outlook mode, so I can onyl advise from the perspective....
Under UltraTree -> ColumnSettings -> RootColumnSet -> Columns I see each of my configured columns....
CascadeAdd and Reference I'll refer too....
CascadeAdd is a workign checkbox... I set the followign properties:
AllowCellEdit = Full
DataType = SYstem.Boolean
EditorControl = (none)
I can set and unset the check box jsut fine. However I can never get the afterCheck event to fire so I'm not havign much luck detecting changes...
Reference is string description of the record table location or a strign description of the field reference type
DataType = SYstem.String
For this I cna edit, the TextChanged event doesn't fire and I've tried assigned various controls to it, but they never appear... Not sure what's going on with that...
Hopefully this will get you a few steps closer....
Now the issue is how to edit the cells ...I mean If I have to change the value of a cell in the column or grid how will I go about it ?
I added these lines and it worked :) .
this.ultraTree1.SetDataBinding(Eset, el.TableName);
this.ultraTree1.SetDataBinding(Eset, es.TableName); this.ultraTree1.Override.ShowExpansionIndicator = Infragistics.Win.UltraWinTree.ShowExpansionIndicator.CheckOnDisplay; this.ultraTree1.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.Grid;
Hey,
T his is my sample code
private DataSet Eset; this.Eset = new DataSet("EsetMap"); DataTable el = getEtitlementSetLicGrp(); DataTable es = getEserverEtitlementSetID(); this.Eset.Tables.Add(es); this.Eset.Tables.Add(el); this.ultraTree1.SetDataBinding(Eset, el.TableName); [working now and as a result is showing me the whole table in grid format ] DataRelation relEntLic; DataColumn col1 = new DataColumn(); DataColumn col2 = new DataColumn(); col1 = this.Eset.Tables["getEserver"].Columns["EntitlementSetID"]; col2 = this.Eset.Tables["getEntitlement"].Columns["EntitlementSetID"]; relEntLic = new DataRelation("RelEntLic", col1, col2, false); Eset.Relations.Add(relEntLic);
Now can you please tell me how to display it using parent child realtion I mean do i have to diaplayteh parent node using for loop as i did earlier ...but its not helping ....