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

TreeList Expand/Collapse

1 Answer 88 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Jesus
Top achievements
Rank 1
Jesus asked on 31 Oct 2014, 02:06 PM
Hi all,

how could we be able to expand/collapse a treeview without passing by the needdatasource event ?

I mean:
    we have a page with a treelist control.
The first load (!page.ispostback) we need to load it empty. The second load (page.ispostback) we load the treelist control with the results of a filter options.

If we click on expand/collapse button it doesn't work (expand/collapse)

Every time we  start an event, treelist goes on needdatasource event to load the object.

How could we be able to expand/collapse a treeview without passing by the needdatasource event , load it and click on expan/collapse button to expand or collapse nodes?

Hope you undestand.
Thank you

BR
Jesús

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 05 Nov 2014, 11:38 AM
Hi Jesus,

Thank you for contacting us.

I am afraid you cannot avoid calling of NeedDataSource event handler when you expand or collapse an item. The reason is that the whole data could not be initially loaded and when expanding an item the needed data is retrieved from the datasource. Nevertheless if you want initially to display RadTreeList empty then you can add the isPostBack check in NeedDataSource event.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeList
Asked by
Jesus
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or