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

Loading Nodes using Webservice - Context?

2 Answers 52 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Amar
Top achievements
Rank 1
Amar asked on 17 Nov 2008, 02:00 PM
Hi,

I am using a WebMethod to return RadTreeNodeData and the tree gets populated fine on demand. I have a requirement to pass more information to the web method when the treenode is expanded. Can someone please point me in the right direction so i may know how to pass additional information in the context parameter in the webmethod.

public RadTreeNodeData[] GetDirectoryNodes(RadTreeNodeData node, object context)

I searched on the forum and in the documentation but have not found any examples.

Thanks

Amar



2 Answers, 1 is accepted

Sort by
0
Amar
Top achievements
Rank 1
answered on 17 Nov 2008, 04:54 PM
After spending a lot of time going through the source code of RadTreeView I managed to find out how to this. The OnClientNodePopulating event needs to be handlled.

OnClientNodePopulating="ClientNodePopulating" 
 

Then

    function ClientNodePopulating(sender, eventArgs) { 
        var data = eventArgs.get_context(); 
        data["testItem"] = "hello"
    } 

0
Veselin Vasilev
Telerik team
answered on 20 Nov 2008, 02:16 PM
Hello Amar,

I am glad that you have found the solution by yourself.

This approach is described in this online help: Load On Demand Support > Web Service Load On Demand

Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Amar
Top achievements
Rank 1
Answers by
Amar
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or