This is a migrated thread and some comments may be shown as answers.
nodePopulating is not calling
1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
Mahmood Ahmad Tahir
Top achievements
Rank 1
Mahmood Ahmad Tahir asked on 02 Oct 2009, 11:59 AM

Im using treeview control in MVC through client side binding and client side method which is assigned to OnClientNodePopulating event, is not calling.

following is the code

 <telerik:RadTreeView runat="server" ID="RadTreeView1" DataTextField="SearchKeyword"
        DataValueField="id" LoadingStatusPosition="AfterNodeText" OnClientNodePopulating="nodePopulating" >
            <telerik:RadTreeNodeBinding Depth="0" ExpandMode="WebService" />

client side code:

function onSuccess(result, node) {
    //the result in JSON format is available as a "d" field
    var data = result.d;

    //Traverse the array of objects and create combobox items
    for (var i = 0; i < data.length; i++) {
        var dataItem = data[i];

        var childNode = new Telerik.Web.UI.RadTreeNode();

function nodePopulating(sender, args) {
    var node = args.get_node();
    node.showLoadingStatus(sender.get_loadingMessage(), sender.get_loadingStatusPosition());
    //get only the child nodes of the current node
    var filter = "&$filter=parentId eq " + node.get_value();

    //Call the ADO.NET Data Service
        type: "GET", // HTTP method
        url: '<%= ResolveUrl("TreeViewAdoNetService.svc/Links?") %>' + filter, // ADO.NET DataService URL
        contentType: "application/json; charset=utf-8", //request the result to be in JSON
        dataType: "json",
        success: function(result) { //callback method to invoke when the request is complete
            onSuccess(result, node);

1 Answer, 1 is accepted

Sort by
Atanas Korchev
Telerik team
answered on 06 Oct 2009, 03:50 PM
Hello Mahmood Ahmad Tahir,

You need at least one root node with ExpandMode=WebService which can be expanded in order to trigger the load on demand (thus nodePopulating) event. Can you confirm the treeivew has at leas one root node?

the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Asked by
Mahmood Ahmad Tahir
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question