Telerik 'RadTreeView' equivalent for ASP.NET 'TreeView'

2 posts, 0 answers
  1. Xorv
    Xorv avatar
    19 posts
    Member since:
    Jan 2012

    Posted 10 Jan 2012 Link to this post

    Hi Admin,

    For the follwing code (asp.net Treeview), please give the telerik equivalent.

     

     

     

     

    foreach (DataRow row in territories.Tables[0].Rows)
                {
                    RadTreeNode newNode = new RadTreeNode(row["terr_rpt_grp_ttl"].ToString(), row["terr_rpt_grp"].ToString());
                    newNode.PopulateOnDemand = true;
                    newNode.SelectAction = TreeNodeSelectAction.Expand;
                    node.ChildNodes.Add(newNode);
                }
            }

     

    The markup defined for the asp.net TreeView is:-

    <asp:TreeView Runat="Server" OnTreeNodePopulate="Node_Populate" ID="tvwauthors">
     
    <Nodes>
     
    <asp:TreeNode Text="ALL" PopulateOnDemand= "true" Value="0"/>
     
    </Nodes>
     
    </asp:TreeView>

      Please help regarding this. Just the telerik equivalent. (For ex. PopulateOnDemand, TreeNodeSelectionAction.Expand etc etc)

    Thanks a lot
    XORV

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jan 2012 Link to this post

    Hello,

    You can easily customize the action when clicking the node, by attaching the 'OnClientNodeClicked' event to RadTreeView instead of SelectAction. For example the following client code shows how to expand/collapse the node when clicking the node.

    JS:
    function OnClientNodeClicked(sender, args)
      
       args.get_node().set_expanded(!args.get_node().get_expanded()); 
      }

    Telerik RadTreeView supports "Load-On-Demand" feature that allows child nodes to be added on the fly as parent nodes are expanded.
    Load On Demand Overview
    Server-Side Load On Demand

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top