Change header text dynamically in TypeScript Treegrid control

18 Nov 20181 minute to read

You can change the column headerText dynamically through an external button.

Follow the given steps to change the header text dynamically:

Step 1:

Get the column object corresponding to the field name by using the getColumnByField method. Then, change the header text value.

let column = treegrid.getColumnByField("taskName"); // Get column object.
column.headerText = 'Changed Text';

Step 2:

To reflect the changes in the treegrid header, invoke the refreshColumns method.

treegrid.refreshColumns();

You can refer to our JavaScript Tree Grid feature tour page for its groundbreaking feature representations. You can also explore our JavaScript Tree Grid example JavaScript Tree Grid example to knows how to present and manipulate data.