Datagrid template


I have a database table with records which have a field (NoteDisplayColour) which contains a Hex colour code. This is shown in the DataGrid component. Is it possible to change the colour (background or text) of the column showing the colour code to actually display using the colour in the Hex field?

I've tried using this template but, it doesn't seem to like using expressions within inline styles:

<span style="color: ${data.NoteDisplayColour};">

I've sorted this one myself...Angular Dynamic binding seems to work:


Just a small correction - the Angular syntax should be:

<span [style.color]="data.NoteDisplayColour">

Didn't know that "" would work.


Thanks for the correction :slight_smile:

Can you please show me where you would put this angular syntax. Many thanks

This code can be used as column template.

I am already using the column template with the following code, is there a way to combine the background colour as well?

<p style="white-space:pre-wrap">${data.JobNo}</p>

Yes, you can add binding for the backgroundColor similar to the example in this thread.