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

[Solved] Treeview OnNodeExpand issue with TreeNodeExpandMode.ServerSideCallBack

2 Answers 321 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
VANDENBERGHE
Top achievements
Rank 1
VANDENBERGHE asked on 03 Jun 2008, 02:11 PM

Hi everyone,

I have a problem with ServerSideCallback. I want to modify some properties of the node which fired the NodeExpand event in the same one.

        protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e)  
        {  
            IList<EntityTypeDataContract> list = GetList(e);  
 
            if (list.Count > 0)  
            {  
                foreach (EntityTypeDataContract type in list)  
                {  
                    RadTreeNode treeNode = new RadTreeNode(type.DisplayName, type.Value);  
                    treeNode.Expanded = false;  
                    treeNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;  
                    e.Node.Nodes.Add(treeNode);  
                }  
            }  
            else  
            {                  
                e.Node.Expanded = false;  
                e.Node.ExpandMode = TreeNodeExpandMode.ClientSide;  
            }  
        } 

The problem is until there will be a postback on the page, the state of the triggering node is not change (Expanded = true and ExpandMode = ServerSideCallback). It seems there is no refresh of the already created node during the callback ?

This sample of code works well with ServerSide expand mode but I really need the ServerSideCallBack mode.

Thanks for helping me to solve this problem.

Regards,
Sebastien

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 03 Jun 2008, 02:26 PM
Hi VANDENBERGHE,

We do not support this capability at the time being. Only the nodes added during the NodeExpand event are updated during ServerSideCallback load on demand. The expanded node does not get updated - setting its properties will not have immediate effect.
In our online demo we have implemented a different technique to find out if a node has children. You can check the implementation of the NodeExpand event. Perhaps you could use the same approach in your application.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
VANDENBERGHE
Top achievements
Rank 1
answered on 03 Jun 2008, 02:31 PM
Thanks for your quick answer.

Regards.
Tags
TreeView
Asked by
VANDENBERGHE
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
VANDENBERGHE
Top achievements
Rank 1
Share this question
or