title: How to expand row from datatable programmatically
body: <p>I want to expand row directly from an typescript method, i've try with @viewchild but it doesn't work :</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;p-dataTable [value]="array" [responsive]="true" expandableRows="true" #dt
     (onRowClick)="dt.toggleRow($event.data)"&gt;
      &lt;template let-test pTemplate="rowexpansion"&gt;
          &lt;div class="ui-grid ui-grid-responsive ui-fluid"&gt;
              &lt;div class="ui-grid-row"&gt;
                  Bouh !
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/template&gt;
      &lt;p-column field="name" header="Vin"&gt;&lt;/p-column&gt;
      &lt;p-column field="company" header="Year"&gt;&lt;/p-column&gt; 
  &lt;/p-dataTable&gt;
  &lt;button class="btn" (click)="addComment()"&gt;
      &lt;p&gt;add comment&lt;/p&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p><strong>Typescript:</strong></p>
  
  <pre><code>import { DataTable } from 'primeng/components/datatable/datatable';
  
  export class MyAwesomeComponent implements OnInit {
  
  @ViewChild('dt') datatable : DataTable;
  
  addComment(): void {
      console.log(this.datatable);
      this.datatable.toggleRow(1);
  }
  </code></pre>
  
  <p>row doesn't expand, if someone could tell me how to do the same thing that (onRowClick) event do but inside a typescript method, i will be grateful.</p>
  
  <p><a href="https://www.primefaces.org/primeng/#/datatable/rowexpansion" rel="noreferrer">Showcase for another html example</a> </p>