Hi Adrian,
Thanks for contacting Syncfusion Support.
Query#:- I have an Angular TreeGrid that I'm trying to update the headers on runtime but is not refreshing.
We are able to replicate the reported problem at our end with your code example. To achieve this requirement, we suggest you to use refreshColumns method instead of refresh method to change the Header’s Text.
Refer to the code example:-
|
ngOnInit(): void {
this.data = projectData;
var proxy = this;
setTimeout(function(){
const column = proxy.treegrid.getColumnByField('StartDate'); // get the JSON object of the column corresponding to the field name
column.headerText = 'Changed Text'; // assign a new header text to the column
proxy.treegrid.refreshColumns();
}, 500);
} |
Also we need to change the HeaderText using setTimeout function after the TreeGrid creation as like given above.
Refer to the API Link:-
Please get back to us if you need any further assistance.
Regards,
Farveen sulthana T