I have use the infragistics ultrawebtree and and i was use the ultrawebmenu for add a new folder.(it will open when i right click the selected node).It works fine.But when i use this menu for rename the node it doesnt work.I need to rename the node text when i right click the node it shows thw ultrawebmenu as a popup,i have the option rename folder,when i click the the selected tree node is changed to edittable.How to do that?
HI,
I created a sample website with a tree and popupmenu. When the selected node is right clicked a context menu appears with a rename option - when rename is selected - the selected node text goes into edit mode.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="Infragistics2.WebUI.UltraWebNavigator.v8.2, Version=8.2.20082.2110, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebNavigator" tagprefix="ignav" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title>
<script type="text/javascript" ><!--
<!--var treeidfunction UltraWebTree1_NodeClick(treeId, nodeId, button){ //Add code to handle your event here. treeid = treeId; if (button == "2") { igmenu_showMenu("UltraWebMenu1", event); return true; }
}// -->
function UltraWebMenu1_ItemClick(menuId, itemId){ //Add code to handle your event here. var item = igmenu_getItemById(itemId); var text = item.getText();
if (text == "rename") { var tree = igtree_getTreeById(treeid) var snode = tree.getSelectedNode(); snode.edit(); }}// --></script></head><body> <form id="form1" runat="server"> <div> <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DefaultImage="" HiliteClass="" HoverClass="" Indentation="20"> <ClientSideEvents NodeClick="UltraWebTree1_NodeClick" /> <Levels> <ignav:Level Index="0" /> </Levels> <Nodes> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> </Nodes> </ignav:UltraWebTree> <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" WebMenuTarget="PopupMenu"> <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px" Cursor="Default"> </IslandStyle> <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White"> </HoverItemStyle> <Images> <SubMenuImage Url="ig_menuTri.gif" /> </Images> <ItemStyle Cursor="Default" /> <Items> <ignav:Item Text="rename"> </ignav:Item> <ignav:Item Text="Top Item"> </ignav:Item> </Items> <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray"> </DisabledStyle> <Levels> <ignav:Level Index="0" /> </Levels> <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass" CustomRules="background-repeat:repeat-x; " /><ExpandEffects ShadowColor="LightGray"></ExpandEffects> <MenuClientSideEvents ItemClick="UltraWebMenu1_ItemClick" /> </ignav:UltraWebMenu> </div> </form></body></html>
Hi,
I have use that code but no response.My problem is when i click the rename option in ultramenu,the selected tree node changed to edited mode that means selected node changed to typing mode i have to type the name.after i type the name and leaving from the node i must goes to the server side events.how to do that.
You need to wire up the Server-Side NodeChanged event. You will also have to modify the UltraWebTree's AutoPostBackFlags properties. In the designer expand the AutoPostBackFlags property and set NodeChanged to true. This will cause a post back after you finish editing a node.
I am attaching my sample project.
Hello,
Thanks for your replay.I have used your code.I have to modified the AutopostBackFlags properties.I have face the problem is when i select the node and select the option rename,it goed to execute client side menu_Click and immedietly goes to the Node_Changed event.I can't edit the node.How to resolve this problem.
HI, can you cut and paste your javascript code - what build of NetAdvantage are you using.
This is my code,
<!--var treeidfunction UltraWebTree1_NodeClick(treeId, nodeId, button){ button1=event.srcElement; treeid = treeId; if (button == "2") {var x=(button1.offsetLeft+button1.offsetWidth)+100;var y=(button1.offsetTop+button1.offsetHeight)+100; igmenu_showMenu("UltraWebMenu1","",x,y); return true; }
function UltraWebMenu1_ItemClick(menuId, itemId){ var item = igmenu_getItemById(itemId); var text = item.getText();
if (text == "rename Folder") { var tree = igtree_getTreeById(treeid) var snode = tree.getSelectedNode(); snode.edit(); }}// --></script></head><body> <form id="form1" runat="server"> <div> <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DefaultImage="" HiliteClass="" HoverClass="" onnodechanged="Node_Changed" Indentation="20"> <ClientSideEvents NodeClick="UltraWebTree1_NodeClick" /> <Levels> <ignav:Level Index="0" /> </Levels> <Nodes> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> <ignav:Node Text="Root Node"> <Nodes> <ignav:Node Text="Child Node"> </ignav:Node> <ignav:Node Text="Child Node"> </ignav:Node> </Nodes> </ignav:Node> </Nodes> </ignav:UltraWebTree> <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" WebMenuTarget="PopupMenu"> <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px" Cursor="Default"> </IslandStyle> <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White"> </HoverItemStyle> <Images> <SubMenuImage Url="ig_menuTri.gif" /> </Images> <ItemStyle Cursor="Default" /> <Items> <ignav:Item Text="rename"> </ignav:Item> <ignav:Item Text="Top Item"> </ignav:Item> </Items> <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray"> </DisabledStyle> <Levels> <ignav:Level Index="0" /> </Levels> <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass" CustomRules="background-repeat:repeat-x; " /><ExpandEffects ShadowColor="LightGray"></ExpandEffects> <MenuClientSideEvents ItemClick="UltraWebMenu1_ItemClick" /> </ignav:UltraWebMenu> </div> </form></body></html>
And i nave set the autoPostBack flag property to nodechanged.
HI I looked thru your aspx page and i didnt see the AutoPostBackFlags.
Bring you project up in Visual Studio. The bring up the WebTree - set the following properties
AutoPostBack = false,
Expand AutoPostBackFlags property and set
NodeChanged = true
NodeChecked = false
NodeCollaspse = false
NodeExpand = false
NodeDropped = false
Here is my aspx postbackflags
<AutoPostBackFlags NodeChanged="True" NodeChecked="False" NodeCollapsed="False" NodeDropped="False" NodeExpanded="False" />
Here is my aspx code for the AutoPostBackFlags