I was wondering if there was any way for me to detect nodes that are being loaded on demand? I noticed that there is not an "AfterDemandLoad" event that I can use to accomplish this so I was wondering if anyone had any ideas. My goal is to be able to attach a custom mouse up event to the nodes that are being loaded. Any suggestions would be greatly appreciated.
On a side note; I noticed during the development of my file explorer control that after a demand load the tag value of the nodes that were loaded are null on the client even though they are set during the demand load event on the server. Additionally, if I tried to do a demand load on any level other than the root level the "e.Node.Tag" property was nothing. As a matter of fact, the only property that I could use on those nodes was the DataPath property. I was just wondering if this is a bug or is this expected behavior?
Hello Hanserya,
Did you find any solution to your problem of not being able to load on demand after the root (1st on demand load). As i am having the same issue where the e.node is giving me null for any information i stored.
Any help would be greatly appreciated.
Thank you,
The only solution I could come up with is to set the DataPath property of the nodes. The value you set to the DataPath is persisted from server to client for all of the nodes in the tree.
The data that I was using to fill the tree was based on a heirarchical data structure. So I would set the datapath property to the ID of the "folder" the node represented and when I would fire the LoadOnDemand event, I would grab the ID from the DataPath and use it to make a data call to retrieve that folder's children and add them as children to the Node and set all the child nodes' DataPath property to their respective ID. If you needed multiple parameters then you could easily concat a string of variables and set the datapath property to the concatenated string and then parse the string in the LoadOnDemand event.
I'm sorry if this dosn't help you.
Thanks for the help.
But found that if you set the LoadonDemand to manual and the viewstate to true. It retains the information of the node which were created on demand.
Thanks again for replying so fast.