I'm trying to color rows in the GridView
based on the state (Enum
value) of underlying item in the row, but none of the solutions I've found in docs seems appropriate for me.
I have DataSource
like this for the GridView
public GridViewDataSet<DTO> Items { get; set; }
DTO
objects come from microservice, so it does not seem reasonable to me to add a property of type BootstrapColor
into DTO object, which is based in the "deep backend" microservice. This approach is inspired by the Sample 2 here:
https://www.dotvvm.com/docs/controls/bootstrap/GridView/2.0
Perhaps, It's possible to use <dot:Decorator>
somehow like in the Sample 5 here:
https://www.dotvvm.com/docs/controls/builtin/GridView/latest
But I haven't found any proper example of using <dot:Decorator>
or <bs:ColorDecorator>
for coloring rows based on some conditions in docs. I can only colour all the rows with the same color.
I've tried to apply some conditions in markup eg.
<RowDecorators>
<bs:ColorDecorator Color="{value: EnumState == StateValue ? Color1 : Color2 }"></bs:ColorDecorator>
</RowDecorators>
but it didn't work
Is there any other way to color rows of the GridView than described above?