Search code examples
angulartypescriptag-gridag-grid-angular

How To Get Selected Row Column Index Of AgGrid (Angular)


Currently I am able to get the row data using gridApi but unable to get the info about what is the column index of selected row?

The function this.gridApi.getSelectedRows() has no properties for this.

Please help.


Solution

  • If you are looking for the displayed column index then try this, using the columnApi:

    var focusedCell = this.gridApi.getFocusedCell();    
    this.columnApi.getAllDisplayedColumns().indexOf(focusedCell.column)