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

RadTreeNode refresh question...

1 Answer 233 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Terry Mulvany
Top achievements
Rank 1
Terry Mulvany asked on 10 Apr 2008, 08:50 PM

I have the following scenerio.

I am using a RadTreeView and on server-side I add root and one child node (folder), expand the root node and set folder node ExpandMoe=ServerSideCallBack.
On client, the user expands the folder node, the NodeExpand event fires and is handled on server and a call to DB gets the one child node and it loads properly and show properly on client.

At this point everything is fine. So the state is Root node expanded, folder node
expanded showing one child item node. I also have a context menu hooked up to the tree and when the user right-clicks the folder node and chooses the 'New' option, an area to the right of the tree opens to allow for data entry.
 The 'Create' button in this area is then clicked causing a postback, data is persisted to DB and code then runs to reload the nodes for the 'selectednode' (the one they right-clicked on in the client). The code that runs is the SAME CODE THAT RUNS WHEN THE USER EXPANDS THE FOLDER NODE.

Now the problem. The client does not reflect the fact that the child nodes of the
folder node (which is currently expanded and showing the original one node) were reloaded/refreshed from DB on server-side. If I F5 the page and drill back down Root -> Folder, the new node shows as expected.

How do you programatically tell the tree... "hey, the selected node, which has already been expanded on-demand, has just had a new node added, now show it".

I am sure this has to do with the asynchronous behavior based on ExpandMode=ServerSideCallBack, but no matter what I try on the server side, the client never shows new child nodes of an ALREADY EXPANDED node. Keep in mind, if the node (folder node that is) had NOT been expanded and I right-click, add New, THEN I expend the folder node, the new data/node shows up fine.

Any and all help is greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 14 Apr 2008, 02:07 PM
Hello Terry Mulvany,

In order to reproduce the problem you have described I created a simple project. It does everything as you specified, except that the data for the new node is static, and the postback is made by a Button on the page. Everything worked as expected.

I have attached the test project. Please download it and check it out. Am I missing something?

Could you post the code which populates the selected node, too? This will help more in identifying the problem.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Terry Mulvany
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or