Skip to content

SyncfusionExamples/How-to-load-data-on-demand-using-command-in-wpf-treegrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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 (SfTreeGrid).

You can load child items for the node in Execute 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 method by passing the child items collection.

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));
    }
}

About

This example illustrates how to load data on demand using command in wpf treegrid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages