This is a migrated thread and some comments may be shown as answers.

[Solved] Client side updating of TreeView

4 Answers 161 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eugene
Top achievements
Rank 1
Eugene asked on 15 Apr 2010, 10:49 PM

Greetings,
     I have a tree that is bound by the following code, which I believe is server side binding:

 

.DataBinding(dataBinding =>

{

dataBinding.Ajax()

.Enabled(

true)

 

.Select(

"LoadArticlesOnDemand", "Home");

 

})

Now, after the app has started and the user has added a node to the tree, I would like to show the entire updated tree with the added node, expanding the tree if necessary.  At the present time, the tree is displayed in the contracted state, showing only the root node.
Is this possible and can you tell me how this may be accomplished?

Thanks in advance,
Eugene

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Apr 2010, 08:02 AM
Hi Eugene,

This is actually ajax binding not server.

We are not fully aware of your scenario and we cannot give you specific instructions how to achieve your goal. Please explain how the user adds a new tree node and when the treeview should be updated. Ideally you could open a support ticket and send us a running sample project.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Eugene
Top achievements
Rank 1
answered on 21 Apr 2010, 07:40 PM
Greetings Atanas ,
    Here is the scenario:  The treeview is displayed and a node is expanded to show the selected node's children.  Case One: a child node is deleted.  In this case, the child node should disappear from the tree and it's parent should be selected.
Case Two:  Same as the first case except that a child node is added instead of deleted.  In this case the new child node should appear under it's parent node (the previously selected node)  and be selected.

Since binding is used and there is no direct control over the display of the tree, how can these cases be handled?

Thanks in advance,
Eugene
0
Atanas Korchev
Telerik team
answered on 22 Apr 2010, 09:46 AM
Hello Eugene,

It is not clear how a node is added or deleted. Depending on the implementation you can either remove or add the required HTML to the treeview or just dataBind it to the new data (nodes). You can check the client-side binding online example for more details.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Joseph Serrano
Top achievements
Rank 1
answered on 29 Apr 2010, 09:12 AM
Hi,

Do you have example of adding new nodes via client-side?

Thanks,

Joseph
Tags
TreeView
Asked by
Eugene
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Eugene
Top achievements
Rank 1
Joseph Serrano
Top achievements
Rank 1
Share this question
or