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

Rad Tree Node Expand event not rising

1 Answer 107 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Naveed
Top achievements
Rank 2
Naveed asked on 31 Dec 2008, 07:30 AM

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?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 31 Dec 2008, 11:53 AM
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.




Tags
TreeView
Asked by
Naveed
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or