RadzenTree questions

1 expand on click , expanding with property does not seem to execute the Expand= handler

I can't seem to reproduce that with the following setup. The Expand handler is ivoked.

 <RadzenTree Data="@nodes" Expand="@OnTreeExpand">
       <RadzenTreeLevel Text="@(data => ((DataNode)data).Data.ToString())" 
             ChildrenProperty="Children" 
             Expanded="@(data => ((DataNode)data).Expanded)"
             HasChildren="@(data => ((DataNode)data).Children != null)" 
       />
</RadzenTree>

@code {
    public class DataNode
    {
        public object Data { get; set; }
        public bool Expanded { get; set; }
        public IEnumerable<DataNode> Children { get; set; }
    }

    DataNode[] nodes = new DataNode[]
    {
        new DataNode
        {
            Data = "Root",
            Expanded = true,
            Children = new [] {
                new DataNode
                {
                    Data = "Child"
                }
            }
        }
    };

   void OnTreeExpand(TreeExpandEventArgs args)
   {
       Console.WriteLine(args.Value);
   }
}

#2 drag and drop

Yes we have this in the roadmap and will probably implement it at some point. It isn't easy indeed but not something we haven't done before :slight_smile:

2 Likes