how to set cursor focus on a cell/ row from code

Hi, How can i set focus on a cell/row after creating the grid with data (just like mouseclick on the row so i cn move the cursor)? I tried the method selectRow() and also property selectedRowIndex but neither has the expected result.

Many thanks
Peter
@ViewChild('MasterTable') table: Grid;


this.rows = res;
this.table.selectRow(1);
 
<ejs-grid class="material maxscreen" height="98vh" #MasterTable
[dataSource]='rows'
[columns]='columns'
[gridLines]="lines"
allowResizing= 'true'
[rowHeight]='rowHeight'
allowReordering='true'
>
</ejs-grid>

1 Reply

IR Isuriya Rajan Syncfusion Team April 23, 2018 07:15 AM UTC

Hi Peter, 
 
Thanks for contacting Syncfusion support, 
 
Using the selectedRowIndex, you can select a row after grid render. 
 
Please refer the below documentation link for your reference: 
 
 
Regards, 
Isuriya R 


Loader.
Up arrow icon