nodePopulating is not calling

2 posts, 0 answers
  1. Mahmood Ahmad Tahir
    Mahmood Ahmad Tahir avatar
    1 posts
    Member since:
    Oct 2009

    Posted 02 Oct 2009 Link to this post


    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);

  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 06 Oct 2009 Link to this post

    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.
Back to Top