Rad Tree Node Expand event not rising

2 posts, 0 answers
  1. Naveed
    Naveed avatar
    5 posts
    Member since:
    Nov 2008

    Posted 31 Dec 2008 Link to this post

    In my scenario I want to add child nodes when any one expend the node or press the plus sign. But the Node expend event is not rising and can I call a java script function (radalert message on a condition) on context menu click event?

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

    Posted 31 Dec 2008 Link to this post

    Hello Naveed,

    To fire the NodeExpand event in the code behind make sure that you have set the node ExpandMode property to ServerSide as shown below. Also refer the following code to dispaly an alert on clicking an item in the ContextMenu.
    aspx:
     <telerik:RadTreeView ID="RadTreeView1" runat="server" OnClientContextMenuItemClicked="ContextMenuClicked" OnNodeExpand="RadTreeView1_NodeExpand"
           <Nodes> 
           <telerik:RadTreeNode ExpandMode="ServerSide" Text="Animals"
           <Nodes>       
           <telerik:RadTreeNode Text="Cat"></telerik:RadTreeNode>   
           <telerik:RadTreeNode Text="Rabbit"></telerik:RadTreeNode>      
           </Nodes> 
           </telerik:RadTreeNode> 
           <telerik:RadTreeNode ExpandMode="ServerSide" Text="Birds"
           <Nodes> 
           <telerik:RadTreeNode Text="Parrot"></telerik:RadTreeNode>       
           <telerik:RadTreeNode Text="Dove"></telerik:RadTreeNode> 
           </Nodes> 
           </telerik:RadTreeNode> 
           </Nodes> 
           <ContextMenus> 
           <telerik:RadTreeViewContextMenu> 
           <Items> 
           <telerik:RadMenuItem Text="Edit"></telerik:RadMenuItem> 
           <telerik:RadMenuItem Text="Delete"></telerik:RadMenuItem> 
           </Items> 
           </telerik:RadTreeViewContextMenu> 
           </ContextMenus> 
    </telerik:RadTreeView> 

    js:
    function ContextMenuClicked() 
     alert('hi') 

    Thanks
    Princy.




Back to Top