Skip to content

Commit 23bc8be

Browse files
ES-975464 - Resolve the ReadMe file length issue in this sample repository
1 parent 6cebc21 commit 23bc8be

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# How to load data on demand using command in wpf treegrid?
2-
This example illustrates how to load data on demand using command in wpf treegrid
1+
# How to load data on demand using command in WPF TreeGrid
2+
3+
This example illustrates how to load data on demand using command in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) (SfTreeGrid).
4+
5+
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.
6+
7+
``` csharp
8+
public void Execute(object parameter)
9+
{
10+
TreeNode node = (parameter as TreeNode);
11+
EmployeeInfo emp = node.Item as EmployeeInfo;
12+
if (emp != null)
13+
{
14+
node.PopulateChildNodes((App.Current.MainWindow.DataContext as ViewModel).GetReportees(emp.ID));
15+
}
16+
}
17+
```

0 commit comments

Comments
 (0)