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

ExpandMode

13 Answers 166 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 28 Jun 2010, 05:55 AM

I have set a RadTreeView to be load on demand using web service method..

node.ExpandMode =

TreeNodeExpandMode.WebService;
[WebMethod]

 

 

public static RadTreeNodeData[] GetChildNodes(RadTreeNodeData node)

{
}

Works fine when clicking on expand cross.

How can i do same thing when single clicking on a tree node or auto expand a node when certain conditions apply.

 

13 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 30 Jun 2010, 02:39 PM
Hi mike,

You can simply expand the clicked node through client code on ClientNodeClicking event.
For example:
function onNodeClicking(sender, args) {
   var node = args.get_node();
   // check if the expandMode is not ClientSide
   if (node.get_expandMode() > 1)
      args.set_cancel(true);
   node.expand();
}

Hope this will 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
0
mike
Top achievements
Rank 1
answered on 05 Jul 2010, 02:27 AM
How can i do this server side, for example when a user first enters treeview screen I wish to expand a particular node, causing the load on demand behind the scenes and have focus on the expanded node?
0
Nikolay Tsenkov
Telerik team
answered on 05 Jul 2010, 02:24 PM
Hi mike,

Well, if you have set the ExpandMode of a node to something different than "ClientSide", calling its expand method client-side, will result in triggering LoadOnDemand.

If you want to expand specific node when the treeView is presented to the client for first time, you can do that on Page_Load time on the server in a "if (!isPostBack){...}" if the TreeView is in a regular page, or persist a flag in the Session if it's on a MasterPage.

Hope this is helpful for 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
0
mike
Top achievements
Rank 1
answered on 06 Jul 2010, 12:07 AM
I now have the expand mode working how I want it to, however, I need to sometimes refresh the expanded node, scenario is such.....

The tree nodes are set to TreeNodeExpandMode.WebService.
When expanding a node the children are appropriately loaded.

In my application the user can right click (context menus) on an expanded node to edit it and its children (sometimes add/delete/rename a child).
Each node will have 2 to 3 levels with x amount of nodes.
Editing occurs within a popup radwindow.

The problem I have is, upon returning from the radwindow I need to refresh the allready expanded node, how can I do this without reloading the whole tree.
I need to somehow unload the expanded node then reload by expanding it.
0
Nikolay Tsenkov
Telerik team
answered on 07 Jul 2010, 07:39 AM
Hi mike,

Currently the problem is only when used ServerSideCallBack and expanded on the server.

Could you please share what kind of scenario would require to have nodes with anything but client-side expand mode over a expanded node? I mean, is there something that you can not achieve with this limitation?

Please if there is such a requirement, share it with us and we will do our best to help you achieve this!

Hope this is helpful for 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
0
mike
Top achievements
Rank 1
answered on 08 Jul 2010, 05:43 AM
I think you may missunder stand me,

What I wish to do is re-populate an already expanded node.
I find that once a node is populated and expanded I have no way to refresh it after changes are made.

Please re-read my last post as it explains what I am trying to accomplish.
0
Nikolay Tsenkov
Telerik team
answered on 12 Jul 2010, 08:34 AM
Hi mike,

Well, once the RadWindow is closed you can:
1. remove the nodes from the currently updated node:
updatedNode.get_nodes().clear();
2. set its ExpandMode to a WebService and expand the node:
node.set_expanded(false);
// "3" is the index of WebService in the TreeNodeExpandMode enumeration
node.set_expandMode(3);
node.set_expanded(true);

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
0
Srinivasa Rao Ranga
Top achievements
Rank 1
answered on 22 Oct 2010, 09:09 AM
Hi Nikolay Tsenkov,

its working fine,but navigate url is not working,pls help me

Thanks!
Srinivasa Rao Ranga
0
Nikolay Tsenkov
Telerik team
answered on 22 Oct 2010, 11:57 AM
Hello Srinivasa Rao Ranga,

Could you, please, explain in a bit more detail what seems to be the problem?
Probably even better approach would be to open a support ticket and send me a sample reproducing it, too.

Hope that soon we will resolve this for 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
0
Srinivasa Rao Ranga
Top achievements
Rank 1
answered on 22 Oct 2010, 12:20 PM
Hi,Nikolay Tsenkov

I am loading the treeview content  using sitemap,my requirement is ,if a user click (single or double) on the parent node,the node should expand,but it is not happenening.

if i use your method:

function onNodeClicking(sender, args) {
   var node = args.get_node();
   // check if the expandMode is not ClientSide
   if (node.get_expandMode() > 1)
      args.set_cancel(true);
   node.expand();
}

its working fine,but navigate url for the child itesms is not working.

Thanks!
Srinivasa Rao Ranga
0
Nikolay Tsenkov
Telerik team
answered on 27 Oct 2010, 11:28 AM
Hi Srinivasa Rao Ranga,

Could you, please, try the following:
function onNodeClicking(sender, args) {
   var node = args.get_node();
   // check if the expandMode is not ClientSide
   if (node.get_expandMode() > 1)
   {
      args.set_cancel(true);
      node.expand();
   }
}

I hope this is going to work for 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
0
Srinivasa Rao Ranga
Top achievements
Rank 1
answered on 27 Oct 2010, 12:41 PM
Hi ,Nikolay Tsenkov

I tried the code,now i am able to navigate,but i am not able to expand on click of the node text instead of "+" symbol

Thanks!
Srinivas
0
Nikolay Tsenkov
Telerik team
answered on 01 Nov 2010, 12:21 PM
Hi Srinivasa Rao Ranga,

Please, post a simple page and an algorithm to reproduce the problem you experience.
I am starting to confuse, what exactly is the scenario in which you are not able expand and navigate.

Hope that soon we will resolve the problem!


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
mike
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
mike
Top achievements
Rank 1
Srinivasa Rao Ranga
Top achievements
Rank 1
Share this question
or