How to change the background color of a row in flexgrid from Typescript?

Posted by: rakesh.thummanapelly on 22 November 2022, 12:47 am EST

  • Posted 22 November 2022, 12:47 am EST

    How to change the background color of a row in flexgrid from Typescript ?

  • Posted 22 November 2022, 3:33 pm EST

    Hi,

    You can handle the ‘formatItem’ event of the flexGrid, to change the color of the cells in the rows.

    You can refer to the following sample, where color of alternate row is changed - https://stackblitz.com/edit/typescript-msdmzv?file=index.ts

    Regards

  • Posted 22 November 2022, 3:48 pm EST

    Thank you for the response.

    I have few disabled cells (read only) in the row. The color should not apply to it.

  • Posted 23 November 2022, 7:46 pm EST

    Hi,

    To avoid this problem, you can add an extra condition in the ‘formatItem’ event handler to check if the cell is disabled or not, and apply the color accordingly.

    Please refer to the following updated sample for the same - https://stackblitz.com/edit/typescript-msdmzv?file=style.css

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels