Programmatically expand tree

Hello,
i tried to expand programmatically tree using calling expand event but its not work for me..
i using load on demand to expand and that method i call when i want to expand it...

Hi @Poojank,

You can use the Expanded option of the RadzenTreeLevel. It is passed a data item similar to HasChildren. You should return true if you want the node data-bound to that item to be expanded. Something like

<RadzenTree Expanded=@(data => (e as TreeNode).SomeText == "ToExpand") />

i already tried but its not working to expand it when i expand it from the method programmatically,
i want to expand it from using loadtree method which i used as method of expand

I am not sure what this means.

Hello @korchev,
i have a method for expand Tree which is LoadTree but i am using other method to expand and i called method LoadTree from there then as per that Tree node should be Expand but its not working


image

Hi @korchev
I am going to create look like a File Explorer in which mean as per image if i click on right hand side folder then tree view should be expand as per the open folder

image

You seem to be instantiating manually event arguments and calling the event handler method. This will not do anything as it isn't the RadzenTree triggering the event. You can check the actual implementation of the Expand event to see what happens inside.