Hi
My ultratree is bind to a datasource. Ultratree is populating the nodes correctly.
Now I want to add few more nodes to the existing nodes. Can anyone please help me to solve the problem.
Thanks in advance.
Navi
You have to add rows to the data source. The control listens for this and adds new nodes as required.
Hi Brain
When i add nodes to the control, I am getting an exception saying "Cannot add to a bound nodes collection."
How to overcome this problem
Regards
As I stated originally, you have to add rows to the data source.
Example:DataSet ds = this.ultraTree1.DataSource as DataSet;DataTable tb = ds.Tables["Whatever"];tb.Rows.Add( new object[{ blah, blah, blah } );
In the example you have stated, the value for the Dataset ds is null.
I mean ultratree.datasource is not able to convert as an dataset.
Can you check this and help me out
Given the amount of detail you provided I had to generalize a bit. You had to have assigned a value to the DataSource property (possibly did so using the SetDataBinding method), so you must also know what you assigned to it. Maybe it was a DataTable, or a BindingList, etc. In any case, you have to find out what it is, and then find out how to add items to it. If you need help with this, please repost with additional details.
Binding the WinTree is the same as binding any other control. You can simply set the DataSource/DataMember properties. Or you can use the SetDataBinding method to set both at once.
Do bind to a hierarchy of data, you must bind to a hierarchical data source, such as a DataSet with one or more Relationships defined.
Hi Rufus,
Can you please tell me how you bind the nodes. I wish to bind parent and child nodes with database table values. I am using 8.1 version. I have tried number of options but unable to bind the data dynamically.
Could you post the code of the same.
Hi Brian,
I have slightly different issue. In my Ultra Tree i am having this Bounded Collection of Nodes fatched using the Dataset from the database.
Using the example u gave i am able to add child node in the bounded Collection of nodes but i want to add a new root node in the Ultra Tree.
Requirement in my case to have Two Root Node and both having child Nodes fatched from diff Database respectively means use of two datasource in one ultra tree.
Ex: RootNode
ChileNode1 (Dataset 1)
ChileNode2 (Dataset 1)
ChildNode3 (Dataset 1)
RootNode2
ChildNode4 (dataset 2)
ChileNode5 (dataset 2)
Regards,
Rufus