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

Optimizing RadTreeView operations

4 Answers 63 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ulrik
Top achievements
Rank 1
Ulrik asked on 23 Aug 2010, 01:46 PM
Hello,

Our application uses a RadTreeView where the node count often gets very high. The user has to be able to manipulate the structure of the tree through drag'n'drop, and by renaming and changing the icons of individual tree nodes. Some of these operations can be initiated by other controls on the page.

It is not a problem that the initial load of the page takes some time, but it is important that any further modifications to the tree happen quickly. Currently, we handle all modifications to the RadTreeView in page Postback events, which obviously makes each request/response involving the RadTreeView blow up to an unacceptable size.

Does anyone know of a good solution to this kind of problem? We are thinking about writing a lot of custom javascript code and using a custom web service instead of the postback events, but we would really like a cleaner and more general solution if that is possible. Is it somehow possible to cache the structure of the RadTreeView on the server, and only send incremental updates to the client?


Thanks,
Ulrik Rasmussen

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 23 Aug 2010, 02:26 PM
You could probably use the XmlHttpPanel and handle all the updates to the RadTreeView in the code-behind by passing all the events using the XmlHttpPanel callback mechanism.

I hope that helps.
0
Nikolay Tsenkov
Telerik team
answered on 23 Aug 2010, 02:36 PM
Hello Ulrik,

If the operations for which your page post-backs don't cause some dataSource updates (to update a db ot xml file) you can probably move this functionality on the client.

But if you need to post back, there isn't a better way than the one that you already mentioned - some custom web-services and javascript to trigger them and to apply results if some.

Even if you cache the treeView, it's still getting into the response. Simply the idea to cache it would be to save some DB queries or dataSource queries in general. This is kind of flaw of the ASP.NET architecture. One control (if bindable) renders to some html, css and javascript and if postback occurs (let's say it's in ajax panel) it's rebound to the dataSource and totally rerendered.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
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
Ulrik
Top achievements
Rank 1
answered on 23 Aug 2010, 02:54 PM
Hello Nikolay,

Yes, unfortunately I have to update a DB (instantly), so I cannot do the changes on the client only (or accumulate them for bulk saving). I think I will go with the cumbersome JavaScript solution then. It would be really nice if ASP.NET supported incremental updates of client controls, but I guess functionality like that would be pretty brittle if not used very carefully, and also result in a bloated session state.

Thanks for your quick answer, it is nice to know that I'm not reinventing the wheel here :).


Cheers,

Ulrik
0
Nikolay Tsenkov
Telerik team
answered on 25 Aug 2010, 11:16 AM
Hi Ulrik,

You are welcome!
And sorry that we can not help you any further on this one. Of course if you get stuck somewhere on the way of implementing this requirement, you can post your problem and I am sure, if not me, than someone else will help you with the solution!

Hope you will achieve this functionality!


Regards,
Nikolay Tsenkov
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
Ulrik
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Nikolay Tsenkov
Telerik team
Ulrik
Top achievements
Rank 1
Share this question
or