VANDENBERGHE
Top achievements
Rank 1
VANDENBERGHE
asked on 06 Jun 2008, 01:21 PM
Hi everyone,
It seems that all the expand methods (server side) don't fire the OnNodeExpandEvent. I need to expand a node server side but when I call the toggle or ExpandAllNode method, I can see the Expand mark but the node is not populated. Is this normal ? Is there a way to force the population of the node server side ?
Regards,
Sebastien.
It seems that all the expand methods (server side) don't fire the OnNodeExpandEvent. I need to expand a node server side but when I call the toggle or ExpandAllNode method, I can see the Expand mark but the node is not populated. Is this normal ? Is there a way to force the population of the node server side ?
Regards,
Sebastien.
5 Answers, 1 is accepted
0
Hello VANDENBERGHE,
We made this behavior by design - you cannot expand a node if its expand mode is set to ServerSide, ServerSideCallBack or WebService.
You can place your expand-code in the place of the toggle() / ExpandAllNodes()
I hope this helps.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
We made this behavior by design - you cannot expand a node if its expand mode is set to ServerSide, ServerSideCallBack or WebService.
You can place your expand-code in the place of the toggle() / ExpandAllNodes()
I hope this helps.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
VANDENBERGHE
Top achievements
Rank 1
answered on 09 Jun 2008, 01:18 PM
Perhaps you need a little more information,
I have a tree with node in ServerSideCallback mode. So when I load my page, I just load the first node level. Now Some people want to load the page with a parameter to choose an already selected node.
What I made with asp.net tree is just using the FindNode method which works fine with PopulateonDemand=true. Therefore I decided to implement my own FindNodeByValuePath method based on one found on your forum.
Here is the code of my method :
I added the currentNode.Toggle(); to try to force the population of the node to find it's children but currentNode.Nodes collection had 0 items.
So how it is possible to populate the child by code ? Without redevelopping the same method than in the OnNodeExpandMethod because I inherit from your tree and try to find a generic way to this method.
Regards,
Sebastien
I have a tree with node in ServerSideCallback mode. So when I load my page, I just load the first node level. Now Some people want to load the page with a parameter to choose an already selected node.
What I made with asp.net tree is just using the FindNode method which works fine with PopulateonDemand=true. Therefore I decided to implement my own FindNodeByValuePath method based on one found on your forum.
Here is the code of my method :
| private char delilmiter = '/'; |
| /// <summary> |
| /// Char delimiter to find a node by its full path. |
| /// </summary> |
| public char Delimiter |
| { |
| get |
| { |
| return delilmiter; |
| } |
| set |
| { |
| delilmiter = value; |
| } |
| } |
| /// <summary> |
| /// Find a node from his full path build with the value. |
| /// </summary> |
| /// <param name="valuePath">Full path of the searched node</param> |
| /// <returns></returns> |
| public RadTreeNode FindNodeByValuePath(string valuePath) |
| { |
| string[] values = valuePath.Split(Delimiter); |
| RadTreeNode currentNode = null; |
| if (values.Length > 0) |
| { |
| currentNode = this.FindNodeByValue(values[0]); |
| if (currentNode != null) |
| { |
| for (int ii = 1; ii < values.Length; ii++) |
| { |
| currentNode.Toggle(); |
| currentNodecurrentNode = currentNode.Nodes.FindNodeByValue(values[ii]); |
| if (currentNode == null) |
| break; |
| } |
| } |
| } |
| return currentNode; |
| } |
I added the currentNode.Toggle(); to try to force the population of the node to find it's children but currentNode.Nodes collection had 0 items.
So how it is possible to populate the child by code ? Without redevelopping the same method than in the OnNodeExpandMethod because I inherit from your tree and try to find a generic way to this method.
Regards,
Sebastien
0
Hi VANDENBERGHE,
I think I understood you correct. Unfortunately calling the toggle() method or setting expanded=true approaches will not work in this case. They work for nodes with ClientSide expand mode.
You need to remove the currentNode.Toggle(); and put the code that gets the children of the currentNode node (most probably this code is in the NodeExpand event handler). Then you can perform the search of the just added nodes.
Let me know if you need more explanation.
Kind regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I think I understood you correct. Unfortunately calling the toggle() method or setting expanded=true approaches will not work in this case. They work for nodes with ClientSide expand mode.
You need to remove the currentNode.Toggle(); and put the code that gets the children of the currentNode node (most probably this code is in the NodeExpand event handler). Then you can perform the search of the just added nodes.
Let me know if you need more explanation.
Kind regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
VANDENBERGHE
Top achievements
Rank 1
answered on 11 Jun 2008, 03:58 PM
In fact i found a workaround. I'm inherit from your tree so I added a OnNodeExpandCustom event and fire it from your OnNodeExpand event and from my research if the node is not already loaded and it works fine, but perhaps you will add the search functionnalityin future release ?
0
Accepted
Hello VANDENBERGHE,
I am glad that you have managed to solve the problem.
We do not plan to change this behavior at the time being.
Having other questions - do not hesitate to contact us again.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I am glad that you have managed to solve the problem.
We do not plan to change this behavior at the time being.
Having other questions - do not hesitate to contact us again.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center