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

[Solved] Save and reload treeview source

1 Answer 190 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 24 May 2008, 11:24 AM
Hi,
I have a RadTreeView that has a SitemapDataSource as datasource. When I edit the treeview by dragging a node I change the changes back to the web.sitemap and do a databind() on my treeview and update the UpdatePanel it is in. The problem is that the changes doesn't show because the TreeView reloads the web.sitemap before it has been properly updated.

If I add System.Threading.Thread.Sleep(3000); the TreeView gets updated. Is there a way to raise an event or something when the web.sitemap has been properly saved and THEN rebind the TreeView? I'm not even sure it's the fact that the file hasn't been saved or if it is the sitemapprovider that hasn't been updated.


I was thinking that I might be able to do:
try { save the web.sitemap }
catch { handle error }
finally { databind on the TreeView and update updatepanel }


But it's still the same problem. I'm using updatepanels so a full page refresh is not an option. I would really appreciate if someone has a solution for this, it's been hunting me for weeks now and I really don't want to use the sleep-solution.

1 Answer, 1 is accepted

Sort by
0
Jay
Top achievements
Rank 1
answered on 29 May 2008, 07:13 PM
If anyone has this problem and find my post, I'm just going to say that I solved this problem by replacing my datasource from a sitemapdatasource to a xmldatasource with caching off. The sitemapdatasource probably don't work very well because the sitemapprovider is slow to update it's source.
Tags
TreeView
Asked by
Jay
Top achievements
Rank 1
Answers by
Jay
Top achievements
Rank 1
Share this question
or