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

RadTree, RadNode and RadTreeContextMenu

1 Answer 54 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nuno
Top achievements
Rank 1
Nuno asked on 23 Jul 2010, 10:08 AM

Hi, i'm using a RadTreeView with a RadTreeViewContextMenu.

At my page load i'm building the contextmenu with my options.
Each RadMenuItem is defined with de code below.

RadMenuItem item=new RadMenuItem('Description','../GestaoEntidade.aspx?mode=ins&type='+xxx);
item.Target = "paneMain";

After my menu is finish, i'm adding it to the tree context menu collection.
Then when i'm building the tree i assing too all my nodes the context menu ID;
node.ContextMenuID = contexMenu.ID;

With this i'm trying to achive the following:
open the contextmenu of a node, choose an item, put the node in session and navigate to the item.navigateUrl.

My trouble is to put the node in session.

I've tryed to use the OnContextMenuItemClick event and this puts the node in session but looses the capability of navigate to the item specified url

protected void OnContextMenuItemClick(Object sender, RadTreeViewContextMenuEventArgs e){
Session["TreeNode"]=(RadTreeNode)e.Node;
}
If i do the following, i loose the item.Target hability.
protected void OnContextMenuItemClick(Object sender, RadTreeViewContextMenuEventArgs e){
Session["TreeNode"]=(RadTreeNode)e.Node;
Response.Redirect(e.ItemMenu.navigateUrl);
}

In the end what a want is to navigate to another page, but this page should open in the specified target and have the node information in that page.
Without have to build a menu for each treeNode. Because if i do that everything works fine.

Can someone englight me on the path to follow? If anymore information needed please ask me.

By the way i'm using IE8 and the version of Telerik Controls is 2009.2.286.

Thanks in advance.
Nuno Chumbo

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 29 Jul 2010, 09:25 AM
Hi Nuno,

If you insist on putting the node in the session, you can do exactly what you are currently doing and register a StartupScript (ScriptManager.RegisterStartupScript(...)) at the end of the server handler, which makes the navigation through JavaScript on the client after the post back response is received.

But my advice for you, would be to persist the node in a cookie, instead. You can trap the ClientContextMenuItemClicking event and put the node in a cookie. This way the navigation will not require additional code.

Hope this is going to help you!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Nuno
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or