Datagrid template

Hi,

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};">
    ${data.NoteDisplayColour}
</span>

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

image

Just a small correction - the Angular syntax should be:

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

Didn't know that "this.data.NoteDisplayColour" would work.

1 Like

Thanks for the correction :slight_smile: