SfTreeView<T> .GetTreeData() call returning null

I have a SfTreeView<PersonModel>  where the PersonModel is defined as 

public class PersonModel
{
     public string Code { get; set; }
     public string Name { get; set; }

     public bool Expanded { get; set; }
     public bool Selected { get; set; }

     public bool HasDirectReports { get; set; }
     public IList<PersonModel> DirectReports { get; set; } = new List<PersonModel>();
}

The SfTreeView is hydrated with data, as I've been able to determine in the following method:

private async Task<string[]> GetSelectedPeople()
        {
            var people = await PeopleTreeView.GetTreeData();
#if DEBUG
            Console.WriteLine($"PeopleTreeView is null: {PeopleTreeView == null}");
            Console.WriteLine($"Contents of PeopleTreeView: {JsonConvert.SerializeObject(PeopleTreeView)}");
            Console.WriteLine($"Contents of people:  {JsonConvert.SerializeObject(people)}");
            Console.WriteLine($"People is null: {people == null}");
            Console.WriteLine($"All Selected: {people.AllChecked()}");
#endif
            if (!people.AllChecked())
            {
                return people.CheckedPeopleArray();
            }
            else
            {
                return null;
            }
        }


The problem now arises in 18.2.0.55, and previously did not arise in Syncfusion.Blazor version 18.2.0.46, where the output of the GetTreeData(); returns null, though the SfTreeView is not null and the data contained within seems to be valid.  If this is not a bug how should I go about re-writing the aforementioned source? 


2 Replies 1 reply marked as answer

AB Arthur Butler August 27, 2020 04:03 AM UTC

I also encountered this issue.  The attached simple example demonstrates the issue.

Regards,
Arthur

Attachment: SfTree_simple_89055ab4.zip


SP Sowmiya Padmanaban Syncfusion Team August 28, 2020 11:03 AM UTC

Hi Arthur Butler,  
 
Greetings from Syncfusion support. 
 
We have checked your reported issue with TreeView component and we were able to reproduce it. We have consider this as a bug from our end. It will be included in our next weekly release which is expected to be released at the first week of September 2020. 
  
You can track the below link to status of this issue fix. 
  
  
We appreciate your patience. 
  
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon