The index of the row.
// get the index of the second selected row
let selectedRowIndex = this.grid.selectedRows[1].index;
Gets the rendered cells in the row component.
// get the cells of the third selected row
let selectedRowCells = this.grid.selectedRows[2].cells;
Gets the rendered cells in the row component.
// get the cells of the third selected row
let selectedRowCells = this.grid.selectedRows[2].cells;
Get a reference to the grid that contains the selected row.
handleRowSelection(event) {
// the grid on which the onRowSelectionChange event was triggered
const grid = event.row.grid;
}
<igx-grid
[data]="data"
(onRowSelectionChange)="handleRowSelection($event)">
</igx-grid>
The native DOM element representing the row. Could be null in certain environments.
// get the nativeElement of the second selected row
let selectedRowNativeElement = this.grid.selectedRows[1].nativeElement;
Gets whether the row is pinned.
let isPinned = row.pinned;
Sets whether the row is pinned.
Default value is false
.
this.grid.selectedRows[0].pinned = true;
The data passed to the row component.
// get the row data for the first selected row
let selectedRowData = this.grid.selectedRows[0].rowData;
The data passed to the row component.
// get the row data for the first selected row
let selectedRowData = this.grid.selectedRows[0].rowData;
Gets the ID of the row. A row in the grid is identified either by:
let rowID = this.grid.selectedRows[2].rowID;
Removes the specified row from the grid's data source.
This method emits onRowDeleted
event.
// delete the third selected row from the grid
this.grid.selectedRows[2].delete();
Pins the specified row.
This method emits onRowPinning
event.
// pin the selected row from the grid
this.grid.selectedRows[0].pin();
Unpins the specified row.
This method emits onRowPinning
event.
// unpin the selected row from the grid
this.grid.selectedRows[0].unpin();
Updates the specified row object and the data source record with the passed value.
This method emits onEditDone
event.
// update the second selected row's value
let newValue = "Apple";
this.grid.selectedRows[1].update(newValue);
Sets whether this specific row has disabled functionality for editing and row selection. Default value is
false
.this.grid.selectedRows[0].pinned = true;