From 55582e3deda1fc4661fc6bbe41c17ede5b9c77d6 Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Mon, 18 Aug 2025 11:45:02 +0530 Subject: [PATCH 1/2] ES-975464 - Resolve the ReadMe file length issue in this sample repository --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99ce860..76c9076 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,37 @@ ## About the example -This example illustrates how to populate child nodes asynchronously in uwp treegrid +This example illustrates how to populate child nodes asynchronously in `UWP TreeGrid`. + +You can populate the child nodes asynchronously using `async` and `await` at runtime when retrieving data from web services or any database. This can be performed by `PopulateChildNodes` method from `TreeGridRequestTreeItemsEventArgs.ParentNode` property. + +``` c# +private async void TreeGrid_RequestTreeItems(object sender, TreeGridRequestTreeItemsEventArgs args) +{ + if (args.ParentItem == null) + { + args.ChildItems = viewModel.Employees.Where(x => x.ReportsTo == -1); + } + //if ParentItem not null, then set args.ChildList to the child items for the given ParentItem. + else + { + EmployeeInfo ems = args.ParentItem as EmployeeInfo; + + if (ems != null) + { + await Task.Run(async () => + { + await this.treeGrid.Dispatcher.RunAsync(CoreDispatcherPriority.High, async() => + { + //Get the child items with time delay + var childItems = await viewModel.GetEmployees(ems.ID); + + //Populate the child nodes based on the child items + args.ParentNode.PopulateChildNodes(childItems); + }); + + }); + } + } +} +``` \ No newline at end of file From f29bc2200b424615a5402a4765d5a553ce217b8a Mon Sep 17 00:00:00 2001 From: SreemonPremkumarMuthukrishnan Date: Wed, 22 Oct 2025 11:07:04 +0530 Subject: [PATCH 2/2] ES-975464 - Changes committed --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 76c9076..75160e2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# How to populate child nodes asynchronously in uwp treegrid? +# How to Populate Child Nodes Asynchronously in UWP TreeGrid? -## About the example +This example illustrates how to populate child nodes asynchronously in [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid) (SfTreeGrid). -This example illustrates how to populate child nodes asynchronously in `UWP TreeGrid`. - -You can populate the child nodes asynchronously using `async` and `await` at runtime when retrieving data from web services or any database. This can be performed by `PopulateChildNodes` method from `TreeGridRequestTreeItemsEventArgs.ParentNode` property. +You can populate the child nodes asynchronously using **async** and **await** at runtime when retrieving data from web services or any database. This can be performed by [PopulateChildNodes](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.TreeGrid.TreeNode.html#Syncfusion_UI_Xaml_TreeGrid_TreeNode_PopulateChildNodes_System_Collections_Generic_IEnumerable_System_Object__) method from [TreeGridRequestTreeItemsEventArgs.ParentNode](https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.TreeGrid.TreeGridRequestTreeItemsEventArgs.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridRequestTreeItemsEventArgs_ParentNode) property. ``` c# private async void TreeGrid_RequestTreeItems(object sender, TreeGridRequestTreeItemsEventArgs args)