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

[Solved] how do I capture the return from the server?

1 Answer 128 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 12 Mar 2010, 09:36 PM
I am using LoadOnDemand from a web service to populate a treeview. I am trying to provide functionality so the user can right-click a node and get a context menu to choose Add, Copy, Cut and Delete functionality to edit the tree. In a previous thread:

http://www.telerik.com/community/forums/aspnet-ajax/treeview/how-to-refresh-tree-when-node-is-added-using-webservice-method.aspx

Veronica was kind enough to point me to the technique of collapsing a node, clearing its children, setting its expand mode like this "Telerik.Web.UI.TreeNodeExpandMode.WebService", and then committing the change.

That is great. But, what event can I key on to run this code? All the events provided in the client side API happen BEFORE the edits are made (before the trip to the database) so, how can I wait until AFTER the node is pasted, deleted, or added (after the changes to the database) and THEN update the treeview to reflect the change.

I have been searching the documentation but, I haven't found any way of capturing the return from the server.

Thanks for whatever advice you can offer.

UPDATE: After further research...should I do my operation in reverse? Should I do all the edits on the client side (in the OnClientContextMenuItemClicked event, etc) and then have the server use the ClientOperations property to handle the edits that have just been made, and update the database? For some reason I feel more comfortable editing the database and then making sure the treeview in the browser updates to reflect the changes, in stead of visa versa but, I guess it is all the same in the end. [what if the database update fails for some reason? Then the client will be out of synch with the data.]

1 Answer, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 15 Mar 2010, 03:13 PM
Please disregard/delete this post.

I figured out the source of my confusion, and it was incorrect server-side code that I had written.

Thanks for your help.
Tags
TreeView
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Share this question
or