IvanJosipovic / BlazorTable

Blazor Table Component with Sorting, Paging and Filtering
https://BlazorTable.netlify.app
MIT License
540 stars 109 forks source link

Is it possible to add a class to a Column based off the TableItem Property like you can with a row? #288

Open finnegan0596 opened 3 years ago

finnegan0596 commented 3 years ago

Sorry if I'm missing something obvious.

I am trying to add a colour to a cell based on a value. I thought this would be done like in your example where you have a property in the model that contains the class name and you set the TableRowItem equal to that

<Table TableItem="PersonData" Items="data" PageSize="15" ColumnReorder="true" TableRowClass="@(x => x.RowClass)">

However I've tried doing this at a column level and it does not work. The Class attribute on Column expects a string rather than a Func<TableItem, string> like the above.

Is there a way to add a style dynamically to a Column based off a value in the TableItem?