title: How to implement Virtual scroll on material tree grand child level
body: <p>I have an angular mat-tree with parent, child and grand child level. On clicking of child I am adding grandchild in it. But grandchild having huge data upto 4k records. Which is making tree extremely slow. My code as below</p>
  
  <pre><code>&lt;div *ngIf="isGrandChildLoaded"&gt;&lt;mat-spinner&gt;&lt;/mat-spinner&gt;&lt;/div&gt;
  &lt;mat-tree [dataSource]="dataSource" [treeControl]="treeControl"&gt;
    &lt;!-- This is the tree node template for leaf nodes --&gt;
    &lt;mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding&gt;
      &lt;!-- use a disabled button to provide padding for tree leaf --&gt;
      &lt;button mat-icon-button disabled&gt;&lt;/button&gt;
      {{node.name}}
    &lt;/mat-tree-node&gt;
    &lt;!-- This is the tree node template for expandable nodes --&gt;
    &lt;mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding&gt;
      &lt;button mat-icon-button matTreeNodeToggle
              [attr.aria-label]="'toggle ' + node.name"&gt;
        &lt;mat-icon class="mat-icon-rtl-mirror" (click)="clickTreeNode(node)"&gt;
          {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
        &lt;/mat-icon&gt;
      &lt;/button&gt;
      {{node.name}}
    &lt;/mat-tree-node&gt;
  &lt;/mat-tree&gt;
  </code></pre>
  
  <p>Please note what I have tried in stackblitz: <a href="https://stackblitz.com/edit/angular-fkxgao?file=app/tree-flat-overview-example.ts" rel="nofollow noreferrer">My code</a></p>
  
  <p>I have noted virtual scroll will be the best solution in this case. And I have saw an example: <a href="https://stackblitz.com/edit/simplified-material-tree-with-virtual-scroll?file=app%2Ftree-flat-overview-example.ts" rel="nofollow noreferrer">Refernce</a></p>
  
  <p>But in example it is having <code>virtual-scroll</code> in whole tree level with full dataSource. </p>
  
  <p>How Can add Virtual scroll in grandchild level with 10 elements at a time. So it wont freeze DOM and Tree. Please guide me...</p>