Hi Zachary,
Thanks for contacting Syncfusion Support.
Query#:-I have the column and row index of a cell and I would like to retrieve the object that is bound to that row/cell.
We have achieved your requirement using getRowInfo method of the TreeGrid. Using this method, we can get the rowData information by passing its corresponding row element.
Refer to the code below:-
App.Component.ts
export class AppComponent {
public data: Object[] = [];
public pageSettings: Object;
@ViewChild('treegrid')
public treeGridObj: TreeGridComponent;
ngOnInit(): void {
this.data = sampleData;
this.pageSettings = { pageSize: 10 };
}
onClicked(): void {
var rowElem = this.treeGridObj.getRowByIndex(2); // get the corresponding row
var data = this.treeGridObj.getRowInfo(rowElem).rowData; // get rowData from getRowInfo
console.log(data);
}
} |
Please get back to us if you need any further assistance.
Regards,
Farveen sulthana T