From 23bc8be3a1e09881636d44637d22326c6b87582f Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Fri, 22 Aug 2025 11:41:24 +0530 Subject: [PATCH 1/2] ES-975464 - Resolve the ReadMe file length issue in this sample repository --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa637c6..a2e8f59 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ -# How to load data on demand using command in wpf treegrid? -This example illustrates how to load data on demand using command in wpf treegrid +# How to load data on demand using command in WPF TreeGrid + +This example illustrates how to load data on demand using command in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) (SfTreeGrid). + +You can load child items for the node in [Execute](https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.icommand.execute?view=netframework-4.8) method of `LoadOnDemandCommand`. `Execute` method will get called when user expands the tree node. In `Execute` method, you can populate the child nodes by calling [TreeNode.PopulateChildNodes](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeNode.html#Syncfusion_UI_Xaml_TreeGrid_TreeNode_PopulateChildNodes) method by passing the child items collection. + +``` csharp +public void Execute(object parameter) +{ + TreeNode node = (parameter as TreeNode); + EmployeeInfo emp = node.Item as EmployeeInfo; + if (emp != null) + { + node.PopulateChildNodes((App.Current.MainWindow.DataContext as ViewModel).GetReportees(emp.ID)); + } +} +``` \ No newline at end of file From da74b2e6a434a105711e4c803dea39abb36c3774 Mon Sep 17 00:00:00 2001 From: SreemonPremkumarM Date: Fri, 21 Nov 2025 01:00:29 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2e8f59..95cb06e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# How to load data on demand using command in WPF TreeGrid +# How to Load Data on Demand using Command in WPF TreeGrid? This example illustrates how to load data on demand using command in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) (SfTreeGrid). @@ -14,4 +14,4 @@ public void Execute(object parameter) node.PopulateChildNodes((App.Current.MainWindow.DataContext as ViewModel).GetReportees(emp.ID)); } } -``` \ No newline at end of file +```