Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Igx-grid - Accessing Headers on dynamically generated columns
posted

Hi,

I am having an issue when trying to access the Header property of dynamically generated columns on an igx-grid.

When creating the following grid with an ngFor for the columns:

Using this data:

I get the following grid, which is exactly what I want (row data is unimportant for this demo):

However, I want to be able to use the column's header to perform some functionality when I select a cell.  I use the following function to display the column object:

But when selecting anything from any column (in this example, the first cell in the 'column 2'), the console returns the following:

Investigating further, just receiving the column returns the column object and, right enough, the header is incorrect:

It seems that in dynamically generated columns, even though the headers are visibly set, selecting the cell does not return the correct column header, instead defaulting to the first one.

Can you propose a solution to this problem?

Thanks!

Adam Drew

Parents Reply Children