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

dataBound events fires multiple times

2 Answers 781 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 09 Oct 2015, 08:28 PM

I am binding a function to the treeView's dataBound event.  I'm using a hierarchical data source with a remote url (web api).  I have found that the event fires once before any data is loaded, again when it is loaded, and again for each time I expand a node.  I know lazy loading is enabled by default, but even so I can see in the network traffic that the entire hierarchical data items are loaded just once.  I guess the tree re-binds at each node Expand.  Then I disabled lazy loading, and now the event fires four times after loading the remote data!  My tree has four top-level nodes, so perhaps once for each node?

 I'd like a dataBound event that fires once and only once, after the data is all loaded.

version 2015.3.930

Thanks,

Randy

 

2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 13 Oct 2015, 07:40 AM

Hello Randy,

The dataBound event is triggered each time the rendered state of the TreeView changes. This may be due to loading of remote data, expanding nodes whose children were not rendered, or when nodes are added and removed. I am afraid that there is no event that is triggered when all data is loaded. If you elaborate what you are trying to achieve, we will be happy to suggest a way to achieve this.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Randy
Top achievements
Rank 1
answered on 13 Oct 2015, 11:35 PM

Thanks for the response.  I suspected as much.  I was thinking of the data getting loaded into the dataSource, but this is really an event that is for binding of the data to the treeView, which is different.  What I'm trying to accomplish is a little complicated, I'm going to enter a support ticket for my issue.

Thanks,

Randy

 

Tags
TreeView
Asked by
Randy
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Randy
Top achievements
Rank 1
Share this question
or