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

[Solved] how to refresh tree when node is added using WebService method

1 Answer 134 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 09 Mar 2010, 03:19 AM
I have a treeview that uses a webservice as its datasource, and is setup to use LoadOnDemand. I am using the context menus to allow users to add, move, or delete nodes. My question is this:

once the user clicks Paste (for instance) to add a node they have copied from another location in the tree, the treeview posts back to my asp.net page and that page calls out to the database to add the node to the appropriate parent node. That all works great but, how do I force the parent node that has just had a node added to it to refresh itself, and show the newly added node?

The same goes for deleting a node. Once my code returns from the database functionality that removes the record from the DB, how do I cause the node to refresh itself, showing that its "child" node has been removed?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 09 Mar 2010, 10:35 AM
Hello Roger,

Try using commitChanges() and trackChanges()  methods.

You can also check this how-to article:
Refresh nodes added on demand

If you have more questions please attach the full code so we can be able to help you best.

Please let me know if this was helpful.

All the best,
Veronica Milcheva
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.
Tags
TreeView
Asked by
Roger
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or