html format in blazorise DataGrid

109 Views Asked by At

I'm using the Blazorise DataGrid in my Blazor .NET6 app. In the DataGrid table I want to show html content e.g. a link. So I am providing a string like

<a href="address">This is a link</a>

to the DataGrid. DataGrid is not converting the string to the actual link but is printing the text. How can I format the DataGrid content so that it converts the string to a html element?

Summary:

I provided a string representing a html element to Blazorise DataGrid and expected that this string is converted but it's not.

1

There are 1 best solutions below

0
Henk Holterman On

expected that this string is converted but it's not.

You will have to cast the string to a MarkupString.

Either add a property to your (View)Model or use something like a template column. I don't know the Blazorise Grid.